Commit 6f5ff130 authored by JC Brand's avatar JC Brand

Don't check the cache in getVCard since we don't call it so often anymore

parent fe8ed128
...@@ -1043,7 +1043,6 @@ ...@@ -1043,7 +1043,6 @@
partner_jid = from; partner_jid = from;
resource = Strophe.getResourceFromJid(message_from); resource = Strophe.getResourceFromJid(message_from);
} }
chatbox = this.get(partner_jid); chatbox = this.get(partner_jid);
if (!chatbox) { if (!chatbox) {
xmppchat.getVCard( xmppchat.getVCard(
...@@ -1222,19 +1221,6 @@ ...@@ -1222,19 +1221,6 @@
}); });
xmppchat.getVCard = function (jid, callback, errback) { xmppchat.getVCard = function (jid, callback, errback) {
/* First we check if we don't already have a RosterItem, since it will
* contain all the vCard details.
*/
var model = xmppchat.roster.getItem(jid);
if (model) {
callback(
model.get('jid'),
model.get('fullname'),
model.get('image'),
model.get('image_type'),
model.get('url')
);
} else {
xmppchat.connection.vcard.get($.proxy(function (iq) { xmppchat.connection.vcard.get($.proxy(function (iq) {
$vcard = $(iq).find('vCard'); $vcard = $(iq).find('vCard');
var fullname = $vcard.find('FN').text(), var fullname = $vcard.find('FN').text(),
...@@ -1244,7 +1230,6 @@ ...@@ -1244,7 +1230,6 @@
callback(jid, fullname, img, img_type, url); callback(jid, fullname, img, img_type, url);
}, this), jid, errback); }, this), jid, errback);
} }
}
xmppchat.RosterItems = Backbone.Collection.extend({ xmppchat.RosterItems = Backbone.Collection.extend({
model: xmppchat.RosterItem, model: xmppchat.RosterItem,
......
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