# HG changeset patch # User Sonny Piers # Date 1327722929 -3600 # Node ID bdfbd58b48350298c89448cc22026fc241bd3097 # Parent 6ce66fba02429ce192b3bbf5f54fb70e8d079cb9 Fix plugins. diff --git a/plugins/disco.js b/plugins/disco.js --- a/plugins/disco.js +++ b/plugins/disco.js @@ -49,9 +49,9 @@ Lightstring.stanza.disco = { } }; Lightstring.discoItems = function(aConnection, aTo, aCallback) { - aConnection.send(Lightstring.stanza.disco.items(aTo), function(answer){ + aConnection.send(Lightstring.stanza.disco.items(aTo), function(stanza){ var items = []; - var elms = answer.querySelectorAll('item'); + var elms = stanza.DOM.querySelectorAll('item'); for(var i = 0; i < elms.length; i++) { var node = elms[i]; var item = { @@ -66,11 +66,11 @@ Lightstring.discoItems = function(aConne }); }; Lightstring.discoInfo = function(aConnection, aTo, aNode, aCallback) { - aConnection.send(Lightstring.stanza.disco.info(aTo, aNode), function(answer){ + aConnection.send(Lightstring.stanza.disco.info(aTo, aNode), function(stanza){ var identities = []; var features = []; - var children = answer.firstChild.children; + var children = stanza.DOM.firstChild.children; var length = children.length; for (var i = 0; i < length; i++) { diff --git a/plugins/pubsub.js b/plugins/pubsub.js --- a/plugins/pubsub.js +++ b/plugins/pubsub.js @@ -63,9 +63,9 @@ Lightstring.stanza.pubsub = { }, }; Lightstring.pubsubItems = function(aConnection, aTo, aNode, aCallback) { - aConnection.send(Lightstring.stanza.pubsub.items(aTo, aNode), function(answer){ + aConnection.send(Lightstring.stanza.pubsub.items(aTo, aNode), function(stanza){ var items = []; - var elms = answer.querySelectorAll('item'); + var elms = stanza.DOM.querySelectorAll('item'); for(var i = 0; i < elms.length; i++) { var node = elms[i]; var item = { @@ -84,16 +84,16 @@ Lightstring.pubsubItems = function(aConn }); } Lightstring.pubsubCreate = function(aConnection, aTo, aNode, aFields, aCallback) { - aConnection.send(Lightstring.stanza.pubsub.create(aTo, aNode, aFields), function(answer) { - if(answer.getAttribute('type') === 'result') - aCallback(null, answer); + aConnection.send(Lightstring.stanza.pubsub.create(aTo, aNode, aFields), function(stanza) { + if(stanza.DOM.getAttribute('type') === 'result') + aCallback(null, stanza); else - aCallback(answer, null); + aCallback(stanza, null); }); }; Lightstring.pubsubConfig = function(aConnection, aTo, aNode, aCallback) { - aConnection.send(Lightstring.stanza.pubsub.getConfig(aTo, aNode), function(answer){ - var accessmodel = answer.querySelector('field[var="pubsub#access_model"]').lastChild.textContent; + aConnection.send(Lightstring.stanza.pubsub.getConfig(aTo, aNode), function(stanza){ + var accessmodel = stanza.DOM.querySelector('field[var="pubsub#access_model"]').lastChild.textContent; if(accessmodel) aCallback(accessmodel); else @@ -101,30 +101,30 @@ Lightstring.pubsubConfig = function(aCon }); } Lightstring.pubsubRetract = function(aConnection, aTo, aNode, aItem, aCallback) { - aConnection.send(Lightstring.stanza.pubsub.retract(aTo, aNode, aItem), function(answer){ + aConnection.send(Lightstring.stanza.pubsub.retract(aTo, aNode, aItem), function(stanza){ if(aCallback) - aCallback(answer); + aCallback(stanza); }); } Lightstring.pubsubPublish = function(aConnection, aTo, aNode, aItem, aId, aCallback) { - aConnection.send(Lightstring.stanza.pubsub.publish(aTo, aNode, aItem, aId), function(answer){ + aConnection.send(Lightstring.stanza.pubsub.publish(aTo, aNode, aItem, aId), function(stanza){ if(answer.getAttribute('type') === 'result') - aCallback(null, answer); + aCallback(null, stanza); else - aCallback(answer, null); + aCallback(stanza, null); }); } Lightstring.pubsubDelete = function(aConnection, aTo, aNode, aCallback) { - aConnection.send(Lightstring.stanza.pubsub.delete(aTo, aNode), function(answer){ + aConnection.send(Lightstring.stanza.pubsub.delete(aTo, aNode), function(stanza){ if(aCallback) - aCallback(answer); + aCallback(stanza); }); } Lightstring.pubsubGetAffiliations = function(aConnection, aTo, aNode, aCallback) { - aConnection.send(Lightstring.stanza.pubsub.affiliations(aTo, aNode), function(answer) { - if((answer.getAttribute('type') === 'result') && aCallback) { + aConnection.send(Lightstring.stanza.pubsub.affiliations(aTo, aNode), function(stanza) { + if((stanza.DOM.getAttribute('type') === 'result') && aCallback) { var affiliations = {}; - answer.querySelectorAll('affiliation').forEach(function(affiliation) { + stanza.DOM.querySelectorAll('affiliation').forEach(function(affiliation) { affiliations[affiliation.getAttribute("jid")] = affiliation.getAttribute("affiliation"); }) aCallback(affiliations); diff --git a/plugins/roster.js b/plugins/roster.js --- a/plugins/roster.js +++ b/plugins/roster.js @@ -38,9 +38,9 @@ Lightstring.stanza.roster = { } }; Lightstring.getRoster = function(connection, aCallback) { - connection.send(this.stanza.roster.get(), function(answer){ + connection.send(this.stanza.roster.get(), function(stanza){ var contacts = []; - var elems = answer.querySelectorAll('item'); + var elems = stanza.DOM.querySelectorAll('item'); for(var i = 0; i