Updates #890 Destroy and recreate session upon reconnection

This ensures that carbons will be activated again.
This commit is contained in:
JC Brand 2017-06-15 17:21:57 +02:00
parent 9ee5550cde
commit d527f693c2
5 changed files with 7 additions and 5 deletions

1
.gitignore vendored
View File

@ -16,6 +16,7 @@ eggs
dev-jc.html
inverse-dev.html
inverse-dev-jc.html
converse-logs/*.html

View File

@ -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)

View File

@ -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 () {

View File

@ -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();

View File

@ -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);