Commit cb2dab38 authored by JC Brand's avatar JC Brand

Fetch the user's vcard when you subscribe to them

parent 98bbb791
...@@ -654,7 +654,15 @@ ...@@ -654,7 +654,15 @@
addContactFromForm: function (ev) { addContactFromForm: function (ev) {
ev.preventDefault(); ev.preventDefault();
this.addContact($(ev.target).find('input').val()); converse.getVCard(
$(ev.target).find('input').val(),
$.proxy(function (jid, fullname, image, image_type, url) {
// XXX: Should we perhaps create a roster item here?
this.addContact(jid, fullname);
}, this),
$.proxy(function () {
console.log("An error occured while fetching vcard");
}, this));
$('.search-xmpp').hide(); $('.search-xmpp').hide();
}, },
...@@ -1428,7 +1436,7 @@ ...@@ -1428,7 +1436,7 @@
jid: item.jid, jid: item.jid,
subscription: item.subscription, subscription: item.subscription,
ask: item.ask, ask: item.ask,
fullname: item.name, fullname: item.name || item.jid,
is_last: is_last is_last: is_last
}); });
} else { } else {
......
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