Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
Detects focus user in reliable way(through user real JID). Fixes kicked event when both 307 and 110 status codes are received in MUC presence.
paweldomas8f94ac8b0947
diff --git a/app.js b/app.jsindex dd42826834..f9081ad7fc 100644--- a/app.js+++ b/app.js@@ -710,10 +710,10 @@ $(document).bind('entered.muc', function (event, jid, info, pres) {'connected','connected');- if (Strophe.getResourceFromJid(jid).indexOf('focus') != -1)+ if (info.isFocus){focusJid = jid;- console.info("Ignore focus " + jid);+ console.info("Ignore focus: " + jid +", real JID: " + info.jid);return;}@@ -828,10 +828,9 @@ $(document).bind('presence.muc', function (event, jid, info, pres) {if (displayName && displayName.length > 0)$(document).trigger('displaynamechanged',- [jid, displayName]);- if (Strophe.getResourceFromJid(jid).indexOf('focus') != -1)+ [jid, info.displayName]);+ if (info.isFocus){- console.info("Ignore focus");return;}diff --git a/config.js b/config.jsindex c7abd9350d..e85e37295c 100644--- a/config.js+++ b/config.js@@ -13,6 +13,7 @@ var config = {useNicks: false,bosh: '//jitsi-meet.example.com/http-bind', // FIXME: use xep-0156 for thatclientNode: 'http://jitsi.org/jitsimeet', // The name of client node advertised in XEP-0115 'c' stanza+ focusUserJid: '[email protected]', // The real JID of focus participant//defaultSipNumber: '', // Default SIP numberdesktopSharing: 'ext', // Desktop sharing method. Can be set to 'ext', 'webrtc' or false to disable.chromeExtensionId: 'diibjkoicjeejcmhdnailmkgecihlobk', // Id of desktop streamer Chrome extensiondiff --git a/muc.js b/muc.jsindex 48cf26cd73..2e31bc9ace 100644--- a/muc.js+++ b/muc.js@@ -123,6 +123,13 @@ Strophe.addConnectionPlugin('emuc', {member.affiliation = tmp.attr('affiliation');member.role = tmp.attr('role');+ // Focus recognition+ member.jid = tmp.attr('jid');+ member.isFocus = false;+ if (member.jid && member.jid.indexOf(config.focusUserJid + "/") == 0) {+ member.isFocus = true;+ }+var nicktag = $(pres).find('>nick[xmlns="http://jabber.org/protocol/nick"]');member.displayName = (nicktag.length > 0 ? nicktag.text() : null);@@ -167,11 +174,7 @@ Strophe.addConnectionPlugin('emuc', {if (!$(pres).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>status[code="110"]').length) {delete this.members[from];this.list_members.splice(this.list_members.indexOf(from), 1);- if ($(pres).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>status[code="307"]').length) {- $(document).trigger('kicked.muc', [from]);- } else {- $(document).trigger('left.muc', [from]);- }+ $(document).trigger('left.muc', [from]);}// If the status code is 110 this means we're leaving and we would like// to remove everyone else from our view, so we trigger the event.@@ -183,6 +186,9 @@ Strophe.addConnectionPlugin('emuc', {$(document).trigger('left.muc', member);}}+ if ($(pres).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>status[code="307"]').length) {+ $(document).trigger('kicked.muc', [from]);+ }return true;},onPresenceError: function (pres) {