diff --git a/JitsiConference.js b/JitsiConference.js index b85b860f..6ce3a527 100644 --- a/JitsiConference.js +++ b/JitsiConference.js @@ -1518,8 +1518,9 @@ JitsiConference.prototype.muteParticipant = function(id) { JitsiConference.prototype.onMemberJoined = function( jid, nick, role, isHidden, statsID, status, identity, botType) { const id = Strophe.getResourceFromJid(jid); + const focusid = this.options.config.focusUserJid ? Strophe.getNodeFromJid(this.options.config.focusUserJid) : 'focus'; - if (id === 'focus' || this.myUserId() === id) { + if (id === focusid || this.myUserId() === id) { return; } @@ -1599,8 +1600,9 @@ JitsiConference.prototype._onMemberBotTypeChanged = function(jid, botType) { JitsiConference.prototype.onMemberLeft = function(jid) { const id = Strophe.getResourceFromJid(jid); + const focusid = this.options.config.focusUserJid ? Strophe.getNodeFromJid(this.options.config.focusUserJid) : 'focus'; - if (id === 'focus' || this.myUserId() === id) { + if (id === focusid || this.myUserId() === id) { return; } diff --git a/modules/recording/recordingXMLUtils.js b/modules/recording/recordingXMLUtils.js index bdb8251f..476af004 100644 --- a/modules/recording/recordingXMLUtils.js +++ b/modules/recording/recordingXMLUtils.js @@ -89,6 +89,6 @@ export default { * @returns {boolean} True if the presence is from the focus. */ isFromFocus(presence) { - return presence.getAttribute('from').includes('focus'); + return presence.getAttribute('from').includes(config.focusUserJid || 'focus'); } }; diff --git a/modules/xmpp/moderator.js b/modules/xmpp/moderator.js index 5a41e31c..5174ad61 100644 --- a/modules/xmpp/moderator.js +++ b/modules/xmpp/moderator.js @@ -107,8 +107,9 @@ Moderator.prototype.isSipGatewayEnabled = function() { Moderator.prototype.onMucMemberLeft = function(jid) { logger.info(`Someone left is it focus ? ${jid}`); const resource = Strophe.getResourceFromJid(jid); + const focus = Strophe.getNodeFromJid(this.getFocusUserJid()); - if (resource === 'focus') { + if (resource === focus) { logger.info( 'Focus has left the room - leaving conference'); this.eventEmitter.emit(XMPPEvents.FOCUS_LEFT); diff --git a/modules/xmpp/strophe.jingle.js b/modules/xmpp/strophe.jingle.js index 0d0cd98d..4b132e05 100644 --- a/modules/xmpp/strophe.jingle.js +++ b/modules/xmpp/strophe.jingle.js @@ -36,6 +36,7 @@ export default class JingleConnectionPlugin extends ConnectionPlugin { constructor(xmpp, eventEmitter, iceConfig) { super(); this.xmpp = xmpp; + this.focus = config.focusUserJid ? Strophe.getNodeFromJid(config.focusUserJid) : 'focus'; this.eventEmitter = eventEmitter; this.sessions = {}; this.jvbIceConfig = iceConfig.jvb; @@ -127,7 +128,7 @@ export default class JingleConnectionPlugin extends ConnectionPlugin { // FIXME that should work most of the time, but we'd have to // think how secure it is to assume that user with "focus" // nickname is Jicofo. - const isP2P = Strophe.getResourceFromJid(fromJid) !== 'focus'; + const isP2P = Strophe.getResourceFromJid(fromJid) !== this.focus; // see http://xmpp.org/extensions/xep-0166.html#concepts-session