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

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