Selaa lähdekoodia

Clear the roster when a BOSH session can't be restored

Fixes #555
JC Brand 9 vuotta sitten
vanhempi
commit
26b45be9e0
2 muutettua tiedostoa jossa 7 lisäystä ja 3 poistoa
  1. 4 2
      converse.js
  2. 3 1
      docs/CHANGES.md

+ 4 - 2
converse.js

@@ -6209,7 +6209,8 @@
                 try {
                     return this.connection.restore(this.jid, this.onConnectStatusChanged);
                 } catch (e) {
-                    converse.log("Could not restore session for jid: "+this.jid+" Error message: "+e.message);
+                    this.log("Could not restore session for jid: "+this.jid+" Error message: "+e.message);
+                    this.clearSession(); // If there's a roster, we want to clear it (see #555)
                 }
             } else { // Not keepalive
                 if (this.jid && this.sid && this.rid) {
@@ -6241,7 +6242,8 @@
                 try {
                     return this.connection.restore(undefined, this.onConnectStatusChanged);
                 } catch (e) {
-                    converse.log("Could not restore sessions. Error message: "+e.message);
+                    this.log("Could not restore session. Error message: "+e.message);
+                    this.clearSession(); // If there's a roster, we want to clear it (see #555)
                 }
             }
             if (this.auto_login) {

+ 3 - 1
docs/CHANGES.md

@@ -16,7 +16,9 @@
   See [include_offline_state](https://conversejs.org/docs/html/configuration.html#include_offline_state) for details. [jcbrand]
 - A chatroom invite might come from someone not in your roster list. [ben]
 - #487 Empty the resources array when the resource is null [rlanvin]
-- #559 Optimize auto_reconnect function. [m0cs]
+- #534 Updated Russian translation [LaconicTranslator]
+- #555 The status restored from sessionStorage is never updated [jcbrand]
+- #559 Remove reconnection timer once connected succesfully [m0cs]
 
 ## 0.10.0 (2015-11-05)