]> cgit.babelmonkeys.de Git - socialXMPP.git/commitdiff
Don't send initial presence before roster is build.
authorFlorian Zeitz <florob@babelmonkeys.de>
Sun, 22 Mar 2009 02:39:41 +0000 (03:39 +0100)
committerFlorian Zeitz <florob@babelmonkeys.de>
Sun, 22 Mar 2009 02:39:41 +0000 (03:39 +0100)
scripts/basic.js

index 984b0cc383236f0d9850ccae0af96d241afcdc42..b7e597b53b9809f2b93b62ae544fe9218ef119f3 100644 (file)
@@ -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());
     }
 }