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 @@
partner_jid = from;
resource = Strophe.getResourceFromJid(message_from);
}
chatbox = this.get(partner_jid);
if (!chatbox) {
xmppchat.getVCard(
......@@ -1222,28 +1221,14 @@
});
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) {
$vcard = $(iq).find('vCard');
var fullname = $vcard.find('FN').text(),
img = $vcard.find('BINVAL').text(),
img_type = $vcard.find('TYPE').text(),
url = $vcard.find('URL').text();
callback(jid, fullname, img, img_type, url);
}, this), jid, errback);
}
xmppchat.connection.vcard.get($.proxy(function (iq) {
$vcard = $(iq).find('vCard');
var fullname = $vcard.find('FN').text(),
img = $vcard.find('BINVAL').text(),
img_type = $vcard.find('TYPE').text(),
url = $vcard.find('URL').text();
callback(jid, fullname, img, img_type, url);
}, this), jid, errback);
}
xmppchat.RosterItems = Backbone.Collection.extend({
......
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