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) {
var $presence = $(pres), is_self;
var $presence = $(pres), is_self, new_room;
var nick = this.model.get('nick');
if ($presence.attr('type') === 'error') {
this.model.set('connection_status', Strophe.Status.DISCONNECTED);
@ -998,13 +998,15 @@
} else {
is_self = ($presence.find("status[code='110']").length) ||
($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);
}
if (converse.muc_instant_rooms) {
this.hideSpinner().showStatusMessages(pres, is_self);
} else {
if (!converse.muc_instant_rooms && new_room) {
this.configureChatRoom();
} else {
this.hideSpinner().showStatusMessages(pres, is_self);
}
}
}
this.occupantsview.updateOccupantsOnPresence(pres);