Room are persistent by default when there is a non temporary working dir.

This commit is contained in:
John Livingston 2021-05-18 18:29:17 +02:00
parent d4b8c8b2e2
commit bc81008ffb
2 changed files with 10 additions and 0 deletions

View File

@ -134,6 +134,8 @@ async function getProsodyConfig (options: RegisterServerOptions): Promise<Prosod
if (paths.permanent) {
// 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?
config.useDefaultPersistent()
}
let logLevel: ProsodyLogLevel | undefined
if (logger.level && (typeof logger.level === 'string')) {

View File

@ -230,6 +230,14 @@ class ProsodyConfigContent {
this.muc.add('modules_enabled', 'muc_moderation')
}
/**
* Rooms will be persistent by default (they will not be deleted if no participant).
* Should not be used when using a temporary dir.
*/
useDefaultPersistent (): void {
this.muc.set('muc_room_default_persistent', true)
}
setLog (level: ProsodyLogLevel, syslog?: ProsodyLogLevel[]): void {
let log = ''
log += 'log = {\n'