Skip to content

Commit

Permalink
Merge pull request #5 from bipmeet/bugfix/user-id-issue-for-moderator
Browse files Browse the repository at this point in the history
fix user id issue for moderator
  • Loading branch information
Apak00 authored Apr 6, 2022
2 parents 54bed2e + 309178f commit cef6573
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions JitsiConference.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,28 +317,7 @@ JitsiConference.prototype.constructor = JitsiConference;
* @static
*/
JitsiConference.resourceCreator = function(jid, isAuthenticatedUser) {
let mucNickname;

if (isAuthenticatedUser) {
// For authenticated users generate a random ID.
mucNickname = RandomUtil.randomHexString(8).toLowerCase();
} else {
// We try to use the first part of the node (which for anonymous users
// on prosody is a UUID) to match the previous behavior (and maybe make
// debugging easier).
mucNickname = Strophe.getNodeFromJid(jid)?.substr(0, 8)
.toLowerCase();

// But if this doesn't have the required format we just generate a new
// random nickname.
const re = /[0-9a-f]{8}/g;

if (!mucNickname || !re.test(mucNickname)) {
mucNickname = RandomUtil.randomHexString(8).toLowerCase();
}
}

return mucNickname;
return RandomUtil.randomHexString(8).toLowerCase();
};

/**
Expand Down

0 comments on commit cef6573

Please sign in to comment.