Commit a3fe6162 authored by JC Brand's avatar JC Brand

Proper MUC reconnection is handled in converse-muc-views

parent ca9d53a6
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
notify_all_room_messages: [ notify_all_room_messages: [
'discuss@conference.conversejs.org' 'discuss@conference.conversejs.org'
], ],
bosh_service_url: 'http://chat.example.org:5280/http-bind/', // bosh_service_url: 'http://chat.example.org:5280/http-bind/',
// bosh_service_url: 'https://conversejs.org/http-bind/', // Please use this connection manager only for testing purposes bosh_service_url: 'https://conversejs.org/http-bind/', // Please use this connection manager only for testing purposes
message_archiving: 'always', message_archiving: 'always',
debug: true debug: true
}); });
......
...@@ -62062,13 +62062,6 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ ...@@ -62062,13 +62062,6 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
return this.__super__.disconnect.apply(this, arguments); return this.__super__.disconnect.apply(this, arguments);
}, },
logOut: function logOut() {
const _converse = this.__super__._converse;
_converse.chatboxviews.closeAllChatBoxes();
return this.__super__.logOut.apply(this, arguments);
},
initStatus: function initStatus(reconnecting) { initStatus: function initStatus(reconnecting) {
const _converse = this.__super__._converse; const _converse = this.__super__._converse;
...@@ -62631,11 +62624,11 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ ...@@ -62631,11 +62624,11 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
}, },
onConnected() { onConnected() {
this.browserStorage = new Backbone.BrowserStorage[_converse.storage](b64_sha1(`converse.chatboxes-${_converse.bare_jid}`)); this.browserStorage = new Backbone.BrowserStorage.session(b64_sha1(`converse.chatboxes-${_converse.bare_jid}`));
this.registerMessageHandler(); this.registerMessageHandler();
this.fetch({ this.fetch({
add: true, 'add': true,
success: this.onChatBoxesFetched.bind(this) 'success': this.onChatBoxesFetched.bind(this)
}); });
}, },
...@@ -62930,11 +62923,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ ...@@ -62930,11 +62923,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
_converse.emit('chatBoxesInitialized'); _converse.emit('chatBoxesInitialized');
}); });
_converse.api.listen.on('beforeTearDown', () => { _converse.api.listen.on('logout', () => {
_converse.chatboxes.remove(); // Don't call off(), events won't get re-registered upon reconnect. _converse.chatboxviews.closeAllChatBoxes();
delete _converse.chatboxes.browserStorage;
}); });
_converse.api.listen.on('presencesInitialized', () => _converse.chatboxes.onConnected()); _converse.api.listen.on('presencesInitialized', () => _converse.chatboxes.onConnected());
...@@ -72212,14 +72202,14 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ ...@@ -72212,14 +72202,14 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
const vcards = []; const vcards = [];
if (this.get('jid')) { if (this.get('jid')) {
vcards.push(this.updateVCard(_converse.vcards.findWhere({ vcards.push(_converse.vcards.findWhere({
'jid': this.get('jid') 'jid': this.get('jid')
}))); }));
} }
vcards.push(this.updateVCard(_converse.vcards.findWhere({ vcards.push(_converse.vcards.findWhere({
'jid': this.get('from') 'jid': this.get('from')
}))); }));
_.forEach(_.filter(vcards, undefined), vcard => { _.forEach(_.filter(vcards, undefined), vcard => {
if (hash && vcard.get('image_hash') !== hash) { if (hash && vcard.get('image_hash') !== hash) {
...@@ -72413,7 +72403,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ ...@@ -72413,7 +72403,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
} }
function disconnectChatRooms() { function disconnectChatRooms() {
/* When disconnecting, or reconnecting, mark all chat rooms as /* When disconnecting, mark all chat rooms as
* disconnected, so that they will be properly entered again * disconnected, so that they will be properly entered again
* when fetched from session storage. * when fetched from session storage.
*/ */
...@@ -72439,8 +72429,6 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ ...@@ -72439,8 +72429,6 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
_converse.on('chatBoxesFetched', autoJoinRooms); _converse.on('chatBoxesFetched', autoJoinRooms);
_converse.on('reconnecting', disconnectChatRooms);
_converse.on('disconnecting', disconnectChatRooms); _converse.on('disconnecting', disconnectChatRooms);
/************************ END Event Handlers ************************/ /************************ END Event Handlers ************************/
...@@ -567,8 +567,8 @@ ...@@ -567,8 +567,8 @@
b64_sha1(`converse.chatboxes-${_converse.bare_jid}`)); b64_sha1(`converse.chatboxes-${_converse.bare_jid}`));
this.registerMessageHandler(); this.registerMessageHandler();
this.fetch({ this.fetch({
add: true, 'add': true,
success: this.onChatBoxesFetched.bind(this) 'success': this.onChatBoxesFetched.bind(this)
}); });
}, },
......
...@@ -1172,7 +1172,7 @@ ...@@ -1172,7 +1172,7 @@
} }
function disconnectChatRooms () { function disconnectChatRooms () {
/* When disconnecting, or reconnecting, mark all chat rooms as /* When disconnecting, mark all chat rooms as
* disconnected, so that they will be properly entered again * disconnected, so that they will be properly entered again
* when fetched from session storage. * when fetched from session storage.
*/ */
...@@ -1193,7 +1193,6 @@ ...@@ -1193,7 +1193,6 @@
} }
}); });
_converse.on('chatBoxesFetched', autoJoinRooms); _converse.on('chatBoxesFetched', autoJoinRooms);
_converse.on('reconnecting', disconnectChatRooms);
_converse.on('disconnecting', disconnectChatRooms); _converse.on('disconnecting', disconnectChatRooms);
/************************ END Event Handlers ************************/ /************************ END Event Handlers ************************/
......
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