浏览代码

We no longer clear the whole roster, only presence data

JC Brand 7 年之前
父节点
当前提交
9afc344b89
共有 2 个文件被更改,包括 3 次插入9 次删除
  1. 1 1
      src/converse-core.js
  2. 2 8
      src/converse-roster.js

+ 1 - 1
src/converse-core.js

@@ -945,7 +945,7 @@
                 _converse.log(
                     "Could not restore session for jid: "+
                     this.jid+" Error message: "+e.message, Strophe.LogLevel.WARN);
-                this.clearSession(); // If there's a roster, we want to clear it (see #555)
+                this.clearSession(); // We want to clear presences (see #555)
                 return false;
             }
         };

+ 2 - 8
src/converse-roster.js

@@ -15,12 +15,6 @@
 
         dependencies: ["converse-vcard"],
 
-        overrides: {
-            _tearDown () {
-                this.__super__._tearDown.apply(this, arguments);
-            }
-        },
-
         initialize () {
             /* The initialize function gets called as soon as the plugin is
              * loaded by converse.js's plugin machinery.
@@ -766,8 +760,8 @@
             });
 
             _converse.api.listen.on('clearSession', () => {
-                if (!_.isUndefined(this.roster)) {
-                    this.roster.browserStorage._clear();
+                if (_converse.presences) {
+                    _converse.presences.browserStorage._clear();
                 }
             });