Debug Mode: new option to promote some JIDs as admins on the MUC component.
This commit is contained in:
@ -12,6 +12,7 @@ import { getAPIKey } from '../apikey'
|
||||
import { parseExternalComponents } from './config/components'
|
||||
import { getRemoteServerInfosDir } from '../federation/storage'
|
||||
import { BotConfiguration } from '../configuration/bot'
|
||||
import { debugMucAdmins } from '../debug'
|
||||
|
||||
async function getWorkingDir (options: RegisterServerOptions): Promise<string> {
|
||||
const peertubeHelpers = options.peertubeHelpers
|
||||
@ -326,6 +327,11 @@ async function getProsodyConfig (options: RegisterServerOptionsV5): Promise<Pros
|
||||
|
||||
config.useTestModule(apikey, testApiUrl)
|
||||
|
||||
const debugMucAdminJids = debugMucAdmins(options)
|
||||
if (debugMucAdminJids) {
|
||||
config.addMucAdmins(debugMucAdminJids)
|
||||
}
|
||||
|
||||
let logLevel: ProsodyLogLevel | undefined
|
||||
if (logger.level && (typeof logger.level === 'string')) {
|
||||
if (logger.level === 'error' || logger.level === 'info' || logger.level === 'debug') {
|
||||
|
@ -463,6 +463,12 @@ class ProsodyConfigContent {
|
||||
}
|
||||
}
|
||||
|
||||
addMucAdmins (jids: string[]): void {
|
||||
for (const jid of jids) {
|
||||
this.muc.add('admins', jid)
|
||||
}
|
||||
}
|
||||
|
||||
setLog (level: ProsodyLogLevel, syslog?: ProsodyLogLevel[]): void {
|
||||
let log = ''
|
||||
log += 'log = {\n'
|
||||
|
Reference in New Issue
Block a user