function getOwnInfo() {
var id = connection.getUniqueId('vCardGet');
- var vCardiq = $iq({'to': Strophe.getBareJidFromJid(connection.jid),
- 'id': id,
- 'type': 'get'}
+ var vCardiq = $iq({'id': id, 'type': 'get'}
).c('vCard', {'xmlns':NS_VCARD});
connection.addHandler(_cbOwnVCard, null, 'iq', 'result', id);
connection.send(vCardiq.tree());
}
+
function addFriend(jid, nick) {
roster[jid2id(jid)] = new Buddy(nick, jid);
$('#friends').append('<div class="friend" id="'+jid2id(jid)+'"><img src="imgs/none.png" /><br /><a class="nick">'+nick+'</a></div>');
var id = e.getAttribute('id');
var jid = e.getAttribute('from');
- var response = $iq({id: id, type: 'result', to: jid});
+ if (jid) {
+ var response = $iq({id: id, type: 'result', to: jid});
+ } else {
+ var response = $iq({id: id, type: 'result'});
+ }
var query = response.c('query', {xmlns: Strophe.NS.DISCO_INFO})
query.c('identity', {category: 'client', type: 'web', name: appName}).up();
for (var i = 0; i < features.length; i++) {