Commit 0a99b9f2 authored by JC Brand's avatar JC Brand

Don't query for room features for restored chat rooms.

parent efa87768
...@@ -358,11 +358,17 @@ ...@@ -358,11 +358,17 @@
// So working around that fact here: // So working around that fact here:
this.$el.find('.chat-content').on('scroll', this.markScrolled.bind(this)); this.$el.find('.chat-content').on('scroll', this.markScrolled.bind(this));
this.registerHandlers();
if (this.model.get('connection_status') !== Strophe.Status.CONNECTED) {
this.getRoomFeatures().always(function () { this.getRoomFeatures().always(function () {
that.join(); that.join();
that.fetchMessages(); that.fetchMessages();
_converse.emit('chatRoomOpened', that); _converse.emit('chatRoomOpened', that);
}); });
} else {
this.fetchMessages();
_converse.emit('chatRoomOpened', that);
}
}, },
render: function () { render: function () {
...@@ -1105,7 +1111,6 @@ ...@@ -1105,7 +1111,6 @@
if (!nick) { if (!nick) {
return this.checkForReservedNick(); return this.checkForReservedNick();
} }
this.registerHandlers();
if (this.model.get('connection_status') === Strophe.Status.CONNECTED) { if (this.model.get('connection_status') === Strophe.Status.CONNECTED) {
// We have restored a chat room from session storage, // We have restored a chat room from session storage,
// so we don't send out a presence stanza again. // so we don't send out a presence stanza again.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment