Commit 4a2048ba authored by JC Brand's avatar JC Brand

Found a better way to ensure roster is fetched after reconnecting.

parent a2ba3ccd
......@@ -49,20 +49,20 @@
onDisconnected: function () {
var result = this._super.onDisconnected.apply(this, arguments);
if (result === 'disconnected') {
// Set connected to `false`, so that if we reconnect,
// "onConnected" will be called, to fetch the roster again and
// to send out a presence stanza.
var view = converse.chatboxviews.get('controlbox');
view.model.set({connected:false});
// If we're not going to reconnect, then render the login
// panel.
if (result === 'disconnected') {
view.$('#controlbox-tabs').empty();
view.renderLoginPanel();
}
return result;
},
afterReconnected: function () {
this._super.afterReconnected.apply(this, arguments);
converse.chatboxviews.get("controlbox").onConnected();
},
_tearDown: function () {
this._super._tearDown.apply(this, arguments);
if (this.rosterview) {
......
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