Przeglądaj źródła

Bugfix. Roster didn't appear in some cases.

Make sure the last roster item is still added (even if it's a zombie), so that
the roster will be shown (roster is only shown when last_item property is
true).
JC Brand 11 lat temu
rodzic
commit
4ab3498285
1 zmienionych plików z 4 dodań i 3 usunięć
  1. 4 3
      converse.js

+ 4 - 3
converse.js

@@ -2644,12 +2644,13 @@
                     if (this.isSelf(item.jid)) { return; }
                     var model = this.get(item.jid);
                     if (!model) {
-                        if ((item.subscription === 'none') && (item.ask === null)) {
+                        var is_last = (index === (items.length-1)) ? true : false;
+                        if ((item.subscription === 'none') && (item.ask === null) && !is_last) {
                             // We're not interested in zombies
+                            // (Hack: except if it's the last item, then we still
+                            // add it so that the roster will be shown).
                             return;
                         }
-                        is_last = false;
-                        if (index === (items.length-1)) { is_last = true; }
                         this.create({
                             jid: item.jid,
                             subscription: item.subscription,