Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

Adopts kick to new focus.

paweldomascd6264d0df83
diff --git a/app.js b/app.js
index e876f306ef..96fbda5bec 100644
--- a/app.js
+++ b/app.js
@@ -603,16 +603,6 @@ $(document).bind('conferenceCreated.jingle', function (event, focus)
}
});
-$(document).bind('callterminated.jingle', function (event, sid, jid, reason) {
- // Leave the room if my call has been remotely terminated.
- if (connection.emuc.joined && reason === 'kick') {
- sessionTerminated = true;
- connection.emuc.doLeave();
- messageHandler.openMessageDialog("Session Terminated",
- "Ouch! You have been kicked out of the meet!");
- }
-});
-
$(document).bind('setLocalDescription.jingle', function (event, sid) {
// put our ssrcs into presence so other clients can identify our stream
var sess = connection.jingle.sessions[sid];
@@ -852,6 +842,17 @@ $(document).bind('presence.status.muc', function (event, jid, info, pres) {
});
+$(document).bind('kicked.muc', function (event, jid) {
+ console.info(jid + " has been kicked from MUC!");
+ if (connection.emuc.myroomjid === jid) {
+ sessionTerminated = true;
+ disposeConference(false);
+ connection.emuc.doLeave();
+ messageHandler.openMessageDialog("Session Terminated",
+ "Ouch! You have been kicked out of the meet!");
+ }
+});
+
$(document).bind('passwordrequired.muc', function (event, jid) {
console.log('on password required', jid);
diff --git a/moderatemuc.js b/moderatemuc.js
index 2b481a8e2e..19f15907cb 100644
--- a/moderatemuc.js
+++ b/moderatemuc.js
@@ -1,4 +1,4 @@
-/* global $, $iq, config, connection, Strophe, toggleAudio */
+/* global $, $iq, config, connection, messageHandler, Strophe, toggleAudio */
/**
* Moderate connection plugin.
*/
@@ -40,7 +40,8 @@ Strophe.addConnectionPlugin('moderate', {
return true;
},
eject: function (jid) {
- connection.jingle.terminateRemoteByJid(jid, 'kick');
+ // We're not the focus, so can't terminate
+ //connection.jingle.terminateRemoteByJid(jid, 'kick');
connection.emuc.kick(jid);
}
});
\ No newline at end of file
diff --git a/muc.js b/muc.js
index b7c02a7a63..48cf26cd73 100644
--- a/muc.js
+++ b/muc.js
@@ -167,7 +167,11 @@ 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);
- $(document).trigger('left.muc', [from]);
+ 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]);
+ }
}
// 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.