Ver código fonte

Bugfix. Use findItem instead of get to check the roster

JC Brand 12 anos atrás
pai
commit
a723a3940b
1 arquivos alterados com 3 adições e 4 exclusões
  1. 3 4
      converse.js

+ 3 - 4
converse.js

@@ -1354,7 +1354,7 @@
 
                 if (xmppchat.auto_subscribe) {
                     if ((!item) || (item.get('subscription') != 'to')) {
-                        if (xmppchat.connection.roster.get(jid)) {
+                        if (xmppchat.connection.roster.findItem(bare_jid)) {
                             $.getJSON(portal_url + "/xmpp-userinfo?user_id=" + Strophe.getNodeFromJid(jid), $.proxy(function (data) {
                                 xmppchat.connection.roster.update(jid, data.fullname, [], function (iq) {
                                     xmppchat.connection.roster.authorize(bare_jid);
@@ -1679,9 +1679,8 @@
             this.storage = new this.ClientStorage(this.connection.bare_jid);
 
             this.chatboxes = new this.ChatBoxes();
-            this.chatboxesview = new this.ChatBoxesView({
-                'model': this.chatboxes
-            });
+            this.chatboxesview = new this.ChatBoxesView({'model': this.chatboxes});
+
             this.roster = new this.RosterItems();
             this.rosterview = Backbone.View.extend(this.RosterView(this.roster, _, $, console));