浏览代码

Bugfix. Use findItem instead of get to check the roster

JC Brand 12 年之前
父节点
当前提交
a723a3940b
共有 1 个文件被更改,包括 3 次插入4 次删除
  1. 3 4
      converse.js

+ 3 - 4
converse.js

@@ -1354,7 +1354,7 @@
 
 
                 if (xmppchat.auto_subscribe) {
                 if (xmppchat.auto_subscribe) {
                     if ((!item) || (item.get('subscription') != 'to')) {
                     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) {
                             $.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.update(jid, data.fullname, [], function (iq) {
                                     xmppchat.connection.roster.authorize(bare_jid);
                                     xmppchat.connection.roster.authorize(bare_jid);
@@ -1679,9 +1679,8 @@
             this.storage = new this.ClientStorage(this.connection.bare_jid);
             this.storage = new this.ClientStorage(this.connection.bare_jid);
 
 
             this.chatboxes = new this.ChatBoxes();
             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.roster = new this.RosterItems();
             this.rosterview = Backbone.View.extend(this.RosterView(this.roster, _, $, console));
             this.rosterview = Backbone.View.extend(this.RosterView(this.roster, _, $, console));