Commit 53643ab5 authored by JC Brand's avatar JC Brand

core: Close chats when logging out, before disconnecting

Otherwise rooms cannot be exited properly.

Also, no need to call `_tearDown` in `logOut` when `connection.disconnect` gets
called since it will get called afterwards in the handler.
parent 3e8e7705
......@@ -577,13 +577,15 @@
};
this.logOut = function () {
_converse.chatboxviews.closeAllChatBoxes();
_converse.clearSession();
_converse.setDisconnectionCause(_converse.LOGOUT, undefined, true);
if (!_.isUndefined(_converse.connection)) {
_converse.connection.disconnect();
}
_converse.chatboxviews.closeAllChatBoxes();
_converse.clearSession();
} else {
_converse._tearDown();
}
_converse.emit('logout');
};
......
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