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:
parent
9ec7167da1
commit
97b85be4ad
@ -4,6 +4,11 @@
|
|||||||
|
|
||||||
* Fix mod_muc_slow_mode: add min value for slow_mode_duration field.
|
* 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.
|
* 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
|
## 8.3.1
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import type { RegisterServerOptions, MVideoThumbnail } from '@peertube/peertube-types'
|
import type { RegisterServerOptions, MVideoThumbnail } from '@peertube/peertube-types'
|
||||||
import { getProsodyDomain } from './domain'
|
import { getProsodyDomain } from './domain'
|
||||||
import { getUserNameByChannelId } from '../../database/channel'
|
import { getUserNameByChannelId } from '../../database/channel'
|
||||||
|
import { BotConfiguration } from '../../configuration/bot'
|
||||||
|
|
||||||
interface Affiliations { [jid: string]: 'outcast' | 'none' | 'member' | 'admin' | 'owner' }
|
interface Affiliations { [jid: string]: 'outcast' | 'none' | 'member' | 'admin' | 'owner' }
|
||||||
|
|
||||||
@ -26,6 +27,15 @@ async function _getCommonAffiliations (options: RegisterServerOptions, prosodyDo
|
|||||||
r[jid] = 'owner'
|
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
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,7 +65,7 @@ async function getVideoAffiliations (options: RegisterServerOptions, video: MVid
|
|||||||
const prosodyDomain = await getProsodyDomain(options)
|
const prosodyDomain = await getProsodyDomain(options)
|
||||||
const r = await _getCommonAffiliations(options, prosodyDomain)
|
const r = await _getCommonAffiliations(options, prosodyDomain)
|
||||||
|
|
||||||
// Adding an 'admin' affiliation for video owner
|
// Adding an 'owner' affiliation for video owner
|
||||||
if (!video.remote) {
|
if (!video.remote) {
|
||||||
// don't add the video owner if it is a remote video!
|
// don't add the video owner if it is a remote video!
|
||||||
await _addAffiliationByChannelId(options, prosodyDomain, r, video.channelId)
|
await _addAffiliationByChannelId(options, prosodyDomain, r, video.channelId)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user