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