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.
This commit is contained in:
John Livingston 2024-03-01 12:20:32 +01:00
parent 9ec7167da1
commit 97b85be4ad
No known key found for this signature in database
GPG Key ID: B17B5640CE66CDBC
2 changed files with 16 additions and 1 deletions

View File

@ -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

View File

@ -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)