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

Disconnect MUCs when we don't have a resumable SMACKS session

parent ec68dc1c
......@@ -1227,7 +1227,7 @@ converse.plugins.add('converse-chatboxes', {
* @namespace _converse.api.chats
* @memberOf _converse.api
*/
'chats': {
chats: {
/**
* @method _converse.api.chats.create
* @param {string|string[]} jid|jids An jid or array of jids
......
......@@ -1968,9 +1968,10 @@ converse.plugins.add('converse-muc', {
_converse.api.listen.on('statusInitialized', () => {
window.addEventListener(_converse.unloadevent, () => {
const using_websocket = _converse.api.connection.isType('websocket');
if (using_websocket && !_converse.enable_smacks) {
// For non-SMACKS websocket connections, we disconnect all
// chatrooms when the page unloads.
if (using_websocket &&
(!_converse.enable_smacks || !_converse.session.get('smacks_stream_id'))) {
// For non-SMACKS websocket connections, or non-resumeable
// connections, we disconnect all chatrooms when the page unloads.
// See issue #1111
disconnectChatRooms();
}
......
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