Created
April 19, 2012 03:03
-
-
Save lfcipriani/2418095 to your computer and use it in GitHub Desktop.
real-time-comparison.js 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// real-time-comparison.js | |
function onConnect(status) | |
{ | |
if (status == Strophe.Status.CONNECTING) { | |
// ... outros status | |
} else if (status == Strophe.Status.CONNECTED) { | |
// adding one handler for each type of XMPP stanza | |
connection.addHandler(onPresence, null, 'presence', null, null, null); | |
connection.addHandler(onIq, null, 'iq', null, null, null); | |
connection.addHandler(onMessage, null, 'message', null, null, null); | |
console.log("Sending presence..."); | |
// app is available to use only after sending and receiving presence from the server | |
connection.send($pres().tree()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment