X-Git-Url: http://cgit.babelmonkeys.de/?p=socialXMPP.git;a=blobdiff_plain;f=scripts%2Fbasic.js;h=b7e597b53b9809f2b93b62ae544fe9218ef119f3;hp=984b0cc383236f0d9850ccae0af96d241afcdc42;hb=4799ac077363c67e5a262442c234382ce8042325;hpb=694dfd793638d1890731e9f6e67494abdfe176b9 diff --git a/scripts/basic.js b/scripts/basic.js index 984b0cc..b7e597b 100644 --- a/scripts/basic.js +++ b/scripts/basic.js @@ -97,6 +97,10 @@ function _cbRoster(e) { } addFriend(entries[item].getAttribute('jid'), nick); } + connection.addHandler(_cbPEP, NS_PEP, 'message'); + var initialPresence = $pres().c('c', {xmlns: NS_CAPS, hash: 'sha-1', node: 'http://jabber.babelmonkeys.de', ver: genCaps()}).up(); + connection.send(initialPresence.tree()); + return false; } @@ -176,10 +180,7 @@ function onConnect(status) { } else if (status == Strophe.Status.CONNECTED) { log('Strophe is connected.'); getRoster(); - connection.addHandler(_cbPEP, NS_PEP, 'message'); connection.addHandler(_cbDisco, Strophe.NS.DISCO_INFO, 'iq', 'get'); - var initialPresence = $pres().c('c', {xmlns: NS_CAPS, hash: 'sha-1', node: 'http://jabber.babelmonkeys.de', ver: genCaps()}).up(); - connection.send(initialPresence.tree()); } }