From 0a99b9f22a7e62eb78361f060324fb5374739094 Mon Sep 17 00:00:00 2001 From: JC Brand Date: Sat, 18 Feb 2017 17:14:30 +0000 Subject: [PATCH] Don't query for room features for restored chat rooms. --- src/converse-muc.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/converse-muc.js b/src/converse-muc.js index 04958a88c..fa7f2a80c 100755 --- a/src/converse-muc.js +++ b/src/converse-muc.js @@ -357,12 +357,18 @@ // Which for some reason doesn't work. // So working around that fact here: this.$el.find('.chat-content').on('scroll', this.markScrolled.bind(this)); - - this.getRoomFeatures().always(function () { - that.join(); - that.fetchMessages(); + + this.registerHandlers(); + if (this.model.get('connection_status') !== Strophe.Status.CONNECTED) { + this.getRoomFeatures().always(function () { + that.join(); + that.fetchMessages(); + _converse.emit('chatRoomOpened', that); + }); + } else { + this.fetchMessages(); _converse.emit('chatRoomOpened', that); - }); + } }, render: function () { @@ -1105,7 +1111,6 @@ if (!nick) { return this.checkForReservedNick(); } - this.registerHandlers(); if (this.model.get('connection_status') === Strophe.Status.CONNECTED) { // We have restored a chat room from session storage, // so we don't send out a presence stanza again.