Fix: if the video owner is already owner of the chatroom, he should not be downgraded to admin.

This commit is contained in:
John Livingston 2021-05-06 21:05:46 +02:00
parent e91d378e5c
commit 5484947f51
2 changed files with 4 additions and 1 deletions

View File

@ -3,6 +3,7 @@
## v2.1.3
* Fix: 2.1.0 was in fact correct... Did not work on my preprod env because of... a Livebox bug...
* Fix: if the video owner is already owner of the chatroom, he should not be downgraded to admin.
## v2.1.2

View File

@ -33,7 +33,9 @@ async function getVideoAffiliations (options: RegisterServerOptions, video: MVid
// don't add the video owner if it is a remote video!
const userName = await _getVideoOwnerUsername(options, video)
const userJid = userName + '@' + prosodyDomain
r[userJid] = 'admin'
if (!(userJid in r)) { // don't override if already owner!
r[userJid] = 'admin'
}
}
} catch (error) {
peertubeHelpers.logger.error('Failed to get video owner informations:', error)