Bugfix. For reserved rooms, only render config form when they're new.

This commit is contained in:
JC Brand 2016-08-12 10:39:57 +00:00
parent eb51c18493
commit 9d28145724

View File

@ -990,7 +990,7 @@
}, },
onChatRoomPresence: function (pres) { onChatRoomPresence: function (pres) {
var $presence = $(pres), is_self; var $presence = $(pres), is_self, new_room;
var nick = this.model.get('nick'); var nick = this.model.get('nick');
if ($presence.attr('type') === 'error') { if ($presence.attr('type') === 'error') {
this.model.set('connection_status', Strophe.Status.DISCONNECTED); this.model.set('connection_status', Strophe.Status.DISCONNECTED);
@ -998,13 +998,15 @@
} else { } else {
is_self = ($presence.find("status[code='110']").length) || is_self = ($presence.find("status[code='110']").length) ||
($presence.attr('from') === this.model.get('id')+'/'+Strophe.escapeNode(nick)); ($presence.attr('from') === this.model.get('id')+'/'+Strophe.escapeNode(nick));
if (this.model.get('connection_status') !== Strophe.Status.CONNECTED) { new_room = $presence.find("status[code='201']").length;
if (is_self) {
this.model.set('connection_status', Strophe.Status.CONNECTED); this.model.set('connection_status', Strophe.Status.CONNECTED);
} if (!converse.muc_instant_rooms && new_room) {
if (converse.muc_instant_rooms) {
this.hideSpinner().showStatusMessages(pres, is_self);
} else {
this.configureChatRoom(); this.configureChatRoom();
} else {
this.hideSpinner().showStatusMessages(pres, is_self);
}
} }
} }
this.occupantsview.updateOccupantsOnPresence(pres); this.occupantsview.updateOccupantsOnPresence(pres);