Skip to content

Instantly share code, notes, and snippets.

@lfcipriani
Created April 19, 2012 03:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lfcipriani/2418103 to your computer and use it in GitHub Desktop.
Save lfcipriani/2418103 to your computer and use it in GitHub Desktop.
function onIq(xml) {
// in this case, the IQ stanzas handled are just subscription results
xmlDom = $(xml);
var iqId = xmlDom.attr('id');
if (iqId == terms[0] || iqId == terms[1]) {
if (xmlDom.find('subscription:first').attr('subscription') == 'subscribed') {
console.log("Subscribed to "+iqId);
}
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment