configuration option to auto-invite matrix users
This commit is contained in:
parent
47b8d44010
commit
9263bdb754
4 changed files with 7 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
const assert = require("assert").strict
|
const assert = require("assert").strict
|
||||||
const DiscordTypes = require("discord-api-types/v10")
|
const DiscordTypes = require("discord-api-types/v10")
|
||||||
|
const reg = require("../../matrix/read-registration")
|
||||||
|
|
||||||
const passthrough = require("../../passthrough")
|
const passthrough = require("../../passthrough")
|
||||||
const { discord, sync, db } = passthrough
|
const { discord, sync, db } = passthrough
|
||||||
|
@ -32,7 +33,7 @@ async function createSpace(guild, kstate) {
|
||||||
events_default: 100, // space can only be managed by bridge
|
events_default: 100, // space can only be managed by bridge
|
||||||
invite: 0 // any existing member can invite others
|
invite: 0 // any existing member can invite others
|
||||||
},
|
},
|
||||||
invite: [],
|
invite: reg.ooye.invite,
|
||||||
topic,
|
topic,
|
||||||
creation_content: {
|
creation_content: {
|
||||||
type: "m.space"
|
type: "m.space"
|
||||||
|
|
|
@ -6,7 +6,9 @@ const yaml = require("js-yaml")
|
||||||
|
|
||||||
/** @ts-ignore @type {import("../types").AppServiceRegistrationConfig} */
|
/** @ts-ignore @type {import("../types").AppServiceRegistrationConfig} */
|
||||||
const reg = yaml.load(fs.readFileSync("registration.yaml", "utf8"))
|
const reg = yaml.load(fs.readFileSync("registration.yaml", "utf8"))
|
||||||
|
reg["ooye"].invite = (reg.ooye.invite || []).filter(mxid => mxid.endsWith(`:${reg.ooye.server_name}`)) // one day I will understand why typescript disagrees with dot notation on this line
|
||||||
assert(reg.ooye.max_file_size)
|
assert(reg.ooye.max_file_size)
|
||||||
assert(reg.ooye.namespace_prefix)
|
assert(reg.ooye.namespace_prefix)
|
||||||
assert(reg.ooye.server_name)
|
assert(reg.ooye.server_name)
|
||||||
|
|
||||||
module.exports = reg
|
module.exports = reg
|
||||||
|
|
|
@ -18,3 +18,5 @@ ooye:
|
||||||
max_file_size: 5000000
|
max_file_size: 5000000
|
||||||
server_name: [the part after the colon in your matrix id, like cadence.moe]
|
server_name: [the part after the colon in your matrix id, like cadence.moe]
|
||||||
server_origin: [the full protocol and domain of your actual matrix server's location, with no trailing slash, like https://matrix.cadence.moe]
|
server_origin: [the full protocol and domain of your actual matrix server's location, with no trailing slash, like https://matrix.cadence.moe]
|
||||||
|
invite:
|
||||||
|
# - @cadence:cadence.moe # uncomment this to auto-invite the named user to newly created spaces
|
||||||
|
|
1
types.d.ts
vendored
1
types.d.ts
vendored
|
@ -21,6 +21,7 @@ export type AppServiceRegistrationConfig = {
|
||||||
max_file_size: number
|
max_file_size: number
|
||||||
server_name: string
|
server_name: string
|
||||||
server_origin: string
|
server_origin: string
|
||||||
|
invite: string[]
|
||||||
}
|
}
|
||||||
old_bridge?: {
|
old_bridge?: {
|
||||||
as_token: string
|
as_token: string
|
||||||
|
|
Loading…
Reference in a new issue