diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dbd94bc..523eb6b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ * Fix mod_muc_slow_mode: add min value for slow_mode_duration field. * Debug Mode: new option to promote some JIDs as admins on the MUC component. +* Fix #322: "Sepia is no longer an owner of this groupchat" message when joining the chat. + * This was related to the fact that the bot was owner because of the "admins" Prosody config key, and not registered in the room. + * To fix it, i added the bot as owner when creating rooms. + * This means that the fix only work for newly created rooms. + * There might still be an issue in ConverseJS or Prosody, don't know exactly where. ## 8.3.1 diff --git a/server/lib/prosody/config/affiliations.ts b/server/lib/prosody/config/affiliations.ts index 2c09945e..4ad17bc8 100644 --- a/server/lib/prosody/config/affiliations.ts +++ b/server/lib/prosody/config/affiliations.ts @@ -1,6 +1,7 @@ import type { RegisterServerOptions, MVideoThumbnail } from '@peertube/peertube-types' import { getProsodyDomain } from './domain' import { getUserNameByChannelId } from '../../database/channel' +import { BotConfiguration } from '../../configuration/bot' interface Affiliations { [jid: string]: 'outcast' | 'none' | 'member' | 'admin' | 'owner' } @@ -26,6 +27,15 @@ async function _getCommonAffiliations (options: RegisterServerOptions, prosodyDo r[jid] = 'owner' } + // Adding the moderation bot JID as room owner. + const settings = await options.settingsManager.getSettings([ + 'disable-channel-configuration' + ]) + const useBots = !settings['disable-channel-configuration'] + if (useBots) { + r[BotConfiguration.singleton().moderationBotJID()] = 'owner' + } + return r } @@ -55,7 +65,7 @@ async function getVideoAffiliations (options: RegisterServerOptions, video: MVid const prosodyDomain = await getProsodyDomain(options) const r = await _getCommonAffiliations(options, prosodyDomain) - // Adding an 'admin' affiliation for video owner + // Adding an 'owner' affiliation for video owner if (!video.remote) { // don't add the video owner if it is a remote video! await _addAffiliationByChannelId(options, prosodyDomain, r, video.channelId)