From: Florian Zeitz Date: Wed, 29 Jul 2009 18:37:28 +0000 (+0200) Subject: Fix Diso answers X-Git-Url: http://git.babelmonkeys.de/?p=socialXMPP.git;a=commitdiff_plain;h=4d2c76c2c6d32a6934e01ffc2ecdb991fe742ef5 Fix Diso answers * to-attribute can be none existant * Update strophejs --- diff --git a/scripts/basic.js b/scripts/basic.js index 62c00c1..d9a14ce 100644 --- a/scripts/basic.js +++ b/scripts/basic.js @@ -136,13 +136,12 @@ function getVCard(jid) { 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('

'+nick+'
'); @@ -193,7 +192,11 @@ function _cbDisco(e) { 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++) { diff --git a/scripts/strophejs b/scripts/strophejs index b3177bf..869a007 160000 --- a/scripts/strophejs +++ b/scripts/strophejs @@ -1 +1 @@ -Subproject commit b3177bf164e2a8d26f18535d117a18f935340379 +Subproject commit 869a007c919936756c3f00cd298450e6a6b27a7a