Handles MUC destroyed event.
This commit is contained in:
parent
053b2d5af2
commit
8042bd2aa6
|
@ -139,6 +139,17 @@ function registerListeners() {
|
|||
messageHandler.openMessageDialog("dialog.sessTerminated", "Session Terminated",
|
||||
"dialog.kickMessage", "Ouch! You have been kicked out of the meet!");
|
||||
});
|
||||
APP.xmpp.addListener(XMPPEvents.MUC_DESTROYED, function (reason) {
|
||||
//FIXME: use Session Terminated from translation, but
|
||||
// 'reason' text comes from XMPP packet and is not translated
|
||||
messageHandler.openDialog(
|
||||
"Session Terminated", reason, true, {},
|
||||
function (event, value, message, formVals)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
);
|
||||
});
|
||||
APP.xmpp.addListener(XMPPEvents.BRIDGE_DOWN, function () {
|
||||
messageHandler.showError("dialog.error","Error",
|
||||
"dialog.bridgeUnavailable",
|
||||
|
|
|
@ -229,6 +229,20 @@ module.exports = function(XMPP, eventEmitter) {
|
|||
},
|
||||
onPresenceUnavailable: function (pres) {
|
||||
var from = pres.getAttribute('from');
|
||||
// room destroyed ?
|
||||
if ($(pres).find('>x[xmlns="http://jabber.org/protocol/muc#user"]' +
|
||||
'>destroy').length) {
|
||||
var reason;
|
||||
var reasonSelect = $(pres).find(
|
||||
'>x[xmlns="http://jabber.org/protocol/muc#user"]' +
|
||||
'>destroy>reason');
|
||||
if (reasonSelect.length) {
|
||||
reason = reasonSelect.text();
|
||||
}
|
||||
XMPP.disposeConference(false);
|
||||
eventEmitter.emit(XMPPEvents.MUC_DESTROYED, reason);
|
||||
return true;
|
||||
}
|
||||
// Status code 110 indicates that this notification is "self-presence".
|
||||
if (!$(pres).find('>x[xmlns="http://jabber.org/protocol/muc#user"]>status[code="110"]').length) {
|
||||
delete this.members[from];
|
||||
|
|
|
@ -11,6 +11,7 @@ var XMPPEvents = {
|
|||
MUC_ENTER: "xmpp.muc_enter",
|
||||
MUC_ROLE_CHANGED: "xmpp.muc_role_changed",
|
||||
MUC_LEFT: "xmpp.muc_left",
|
||||
MUC_DESTROYED: "xmpp.muc_destroyed",
|
||||
DISPLAY_NAME_CHANGED: "xmpp.display_name_changed",
|
||||
REMOTE_STATS: "xmpp.remote_stats",
|
||||
LOCALROLE_CHANGED: "xmpp.localrole_changed",
|
||||
|
|
Loading…
Reference in New Issue