Adopts kick to new focus.

pull/207/head
paweldomas 10 years ago
parent 285096cc99
commit cd6264d0df
  1. 21
      app.js
  2. 5
      moderatemuc.js
  3. 6
      muc.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);

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

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

Loading…
Cancel
Save