Call _tearDown when logging out.

This is necessary for cleaning up after tests (now that each test has its own
initialized converse).

Should hopefully not cause any issues when logging out during normal use.
This commit is contained in:
JC Brand 2016-11-03 09:48:59 +00:00
parent 0c2c7be467
commit 3e4095734b

View File

@ -535,12 +535,13 @@
this.logOut = function () {
converse.disconnection_cause = converse.LOGOUT;
converse.chatboxviews.closeAllChatBoxes();
converse.clearSession();
if (typeof converse.connection !== 'undefined') {
converse.connection.disconnect();
converse.connection.reset();
}
converse.clearSession();
converse._tearDown();
converse.chatboxviews.closeAllChatBoxes();
converse.emit('logout');
};