forked from cadence/out-of-your-element
support threads
This commit is contained in:
parent
213bf0a515
commit
0fc8e68f15
9 changed files with 172 additions and 63 deletions
|
@ -1,5 +1,6 @@
|
|||
// @ts-check
|
||||
|
||||
const assert = require("assert")
|
||||
const passthrough = require("../../passthrough")
|
||||
const { sync, db } = passthrough
|
||||
/** @type {import("../../matrix/api")} */
|
||||
|
@ -9,13 +10,14 @@ const api = sync.require("../../matrix/api")
|
|||
* @param {import("discord-api-types/v10").RESTGetAPIGuildResult} guild
|
||||
*/
|
||||
async function createSpace(guild) {
|
||||
assert(guild.name)
|
||||
const roomID = await api.createRoom({
|
||||
name: guild.name,
|
||||
preset: "private_chat",
|
||||
preset: "private_chat", // cannot join space unless invited
|
||||
visibility: "private",
|
||||
power_level_content_override: {
|
||||
events_default: 100,
|
||||
invite: 50
|
||||
events_default: 100, // space can only be managed by bridge
|
||||
invite: 0 // any existing member can invite others
|
||||
},
|
||||
invite: ["@cadence:cadence.moe"], // TODO
|
||||
topic: guild.description || undefined,
|
||||
|
@ -27,13 +29,13 @@ async function createSpace(guild) {
|
|||
type: "m.room.guest_access",
|
||||
state_key: "",
|
||||
content: {
|
||||
guest_access: "can_join"
|
||||
guest_access: "can_join" // guests can join space if other conditions are met
|
||||
}
|
||||
},
|
||||
{
|
||||
type: "m.room.history_visibility",
|
||||
content: {
|
||||
history_visibility: "invited"
|
||||
history_visibility: "invited" // any events sent after user was invited are visible
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue