comparison plugins/disco.js @ 35:bdfbd58b4835

Fix plugins.
author Sonny Piers <sonny.piers@gmail.com>
date Sat, 28 Jan 2012 04:55:29 +0100
parents 1506992c33e2
children 6773e5bc2ca0
comparison
equal deleted inserted replaced
34:6ce66fba0242 35:bdfbd58b4835
47 47
48 return iq+query+"</iq>"; 48 return iq+query+"</iq>";
49 } 49 }
50 }; 50 };
51 Lightstring.discoItems = function(aConnection, aTo, aCallback) { 51 Lightstring.discoItems = function(aConnection, aTo, aCallback) {
52 aConnection.send(Lightstring.stanza.disco.items(aTo), function(answer){ 52 aConnection.send(Lightstring.stanza.disco.items(aTo), function(stanza){
53 var items = []; 53 var items = [];
54 var elms = answer.querySelectorAll('item'); 54 var elms = stanza.DOM.querySelectorAll('item');
55 for(var i = 0; i < elms.length; i++) { 55 for(var i = 0; i < elms.length; i++) {
56 var node = elms[i]; 56 var node = elms[i];
57 var item = { 57 var item = {
58 jid: node.getAttribute('jid'), 58 jid: node.getAttribute('jid'),
59 name: node.getAttribute('name'), 59 name: node.getAttribute('name'),
64 if(aCallback) 64 if(aCallback)
65 aCallback(items); 65 aCallback(items);
66 }); 66 });
67 }; 67 };
68 Lightstring.discoInfo = function(aConnection, aTo, aNode, aCallback) { 68 Lightstring.discoInfo = function(aConnection, aTo, aNode, aCallback) {
69 aConnection.send(Lightstring.stanza.disco.info(aTo, aNode), function(answer){ 69 aConnection.send(Lightstring.stanza.disco.info(aTo, aNode), function(stanza){
70 var identities = []; 70 var identities = [];
71 var features = []; 71 var features = [];
72 72
73 var children = answer.firstChild.children; 73 var children = stanza.DOM.firstChild.children;
74 var length = children.length; 74 var length = children.length;
75 75
76 for (var i = 0; i < length; i++) { 76 for (var i = 0; i < length; i++) {
77 var child = children[i]; 77 var child = children[i];
78 78