Bot must be admin on the MUC component.

This commit is contained in:
John Livingston 2023-09-19 18:02:57 +02:00
parent e0c31f09aa
commit 9e7d9c6069
No known key found for this signature in database
GPG Key ID: B17B5640CE66CDBC
2 changed files with 10 additions and 0 deletions

View File

@ -217,6 +217,13 @@ class BotConfiguration {
}
}
/**
* Returns the moderation bot JID
*/
public moderationBotJID (): string {
return 'moderator@' + this.botsDomain
}
/**
* frees the singleton
*/

View File

@ -439,6 +439,9 @@ class ProsodyConfigContent {
this.bot.set('modules_enabled', ['ping'])
this.bot.set('authentication', 'peertubelivechat_bot')
// Adding the moderation bot as admin to the muc component.
this.muc.add('admins', BotConfiguration.singleton().moderationBotJID())
const configurationPaths = BotConfiguration.singleton().configurationPaths()
if (configurationPaths.moderation?.globalDir) {
this.bot.set('livechat_bot_conf_folder', configurationPaths.moderation.globalDir)