Commit d527f693 authored by JC Brand's avatar JC Brand

Updates #890 Destroy and recreate session upon reconnection

This ensures that carbons will be activated again.
parent 9ee5550c
......@@ -16,6 +16,7 @@ eggs
dev-jc.html
inverse-dev.html
inverse-dev-jc.html
converse-logs/*.html
......
......@@ -22,6 +22,7 @@
- #754 Show unread messages next to roster contacts. [jcbrand]
- #864 Remove all inline CSS to comply with strict Content-Security-Policy headers [mathiasertl]
- #873 Inconsistent unread messages count updating [novokrest]
- #890 Message carbons not sent out after reconnection [jcbrand]
- #894 Room affiliation lost when connection jid and room presence jid are of different case [Rayzen]
## 3.0.2 (2017-04-23)
......
......@@ -64,9 +64,9 @@
//
// New functions which don't exist yet can also be added.
initSession: function () {
initChatBoxes: function () {
this.__super__.initChatBoxes.apply(this, arguments);
this.controlboxtoggle = new this.ControlBoxToggle();
this.__super__.initSession.apply(this, arguments);
},
initConnection: function () {
......
......@@ -571,7 +571,6 @@
if (!_.isUndefined(this.roster)) {
this.roster.browserStorage._clear();
}
this.session.browserStorage._clear();
};
this.logOut = function () {
......@@ -755,6 +754,7 @@
// by browser.
_converse.connection.flush();
_converse.initSession();
_converse.setUserJid();
_converse.enableCarbons();
......@@ -2090,6 +2090,7 @@
if (this.features) {
this.features.reset();
}
this.session.destroy();
window.removeEventListener('click', _converse.onUserActivity);
window.removeEventListener('focus', _converse.onUserActivity);
window.removeEventListener('keypress', _converse.onUserActivity);
......@@ -2139,7 +2140,6 @@
}
_converse.initPlugins();
_converse.initChatBoxes();
_converse.initSession();
_converse.initConnection();
_converse.setUpXMLLogging();
_converse.logIn();
......
......@@ -1225,7 +1225,7 @@
},
cleanup: function () {
if (this.model.collection.browserStorage) {
if (this.model.collection && this.model.collection.browserStorage) {
this.model.save('connection_status', ROOMSTATUS.DISCONNECTED);
} else {
this.model.set('connection_status', ROOMSTATUS.DISCONNECTED);
......
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