Commit 1966d5ab authored by JC Brand's avatar JC Brand

Fix RosterHandler through proper closure.

parent bd5269c2
...@@ -1524,14 +1524,11 @@ ...@@ -1524,14 +1524,11 @@
}, },
rosterHandler: function (items) { rosterHandler: function (items) {
var model, item, i, items_length = items.length, _.each(items, function (item, index, items) {
last_item = items[items_length - 1], var model = this.getItem(item.jid),
options = {}, vcard, img_src; options = {};
for (i=0; i<items_length; i+=1) {
item = items[i];
model = this.getItem(item.jid);
if (!model) { if (!model) {
if (item === last_item) { if (index === (items.length-1)) {
options.isLast = true; options.isLast = true;
} }
xmppchat.getVCard(item.jid, $.proxy(function (jid, fullname, img, img_type, url) { xmppchat.getVCard(item.jid, $.proxy(function (jid, fullname, img, img_type, url) {
...@@ -1545,7 +1542,8 @@ ...@@ -1545,7 +1542,8 @@
model.set({'subscription': item.subscription, 'ask': item.ask}); model.set({'subscription': item.subscription, 'ask': item.ask});
} }
} }
}
}, this);
}, },
presenceHandler: function (presence) { presenceHandler: function (presence) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment