Merge branch 'release/3.2.0' into prosody_room_list
This commit is contained in:
@ -77,6 +77,7 @@ async function getProsodyConfig (options: RegisterServerOptions): Promise<Prosod
|
||||
if (!/^\d+$/.test(port)) {
|
||||
throw new Error('Invalid port')
|
||||
}
|
||||
const enableC2s = (await options.settingsManager.getSetting('prosody-c2s') as boolean) || false
|
||||
const prosodyDomain = await getProsodyDomain(options)
|
||||
const paths = await getProsodyFilePaths(options)
|
||||
|
||||
@ -99,6 +100,14 @@ async function getProsodyConfig (options: RegisterServerOptions): Promise<Prosod
|
||||
config.usePeertubeBosh(prosodyDomain, port)
|
||||
config.useMucHttpDefault(roomApiUrl)
|
||||
|
||||
if (enableC2s) {
|
||||
const c2sPort = (await options.settingsManager.getSetting('prosody-c2s-port') as string) || '52822'
|
||||
if (!/^\d+$/.test(c2sPort)) {
|
||||
throw new Error('Invalid c2s port')
|
||||
}
|
||||
config.useC2S(c2sPort)
|
||||
}
|
||||
|
||||
// TODO: add a settings so that admin can choose? (on/off and duration)
|
||||
config.useMam('1w') // Remove archived messages after 1 week
|
||||
// TODO: add a settings to choose?
|
||||
|
@ -203,6 +203,10 @@ class ProsodyConfigContent {
|
||||
}
|
||||
}
|
||||
|
||||
useC2S (c2sPort: string): void {
|
||||
this.global.set('c2s_ports', [c2sPort])
|
||||
}
|
||||
|
||||
useMucHttpDefault (url: string): void {
|
||||
this.muc.add('modules_enabled', 'muc_http_defaults')
|
||||
this.muc.add('muc_create_api_url', url)
|
||||
|
Reference in New Issue
Block a user