Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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