comparison plugins/disco.js @ 72:5dbf93cef55d

Various fixes.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Thu, 02 Feb 2012 02:28:18 +0100
parents fdd1ae375067
children 0b8e7ca19f83
comparison
equal deleted inserted replaced
71:f12c759e4097 72:5dbf93cef55d
81 if (aResult) 81 if (aResult)
82 aResult(stanza); 82 aResult(stanza);
83 }, aError); 83 }, aError);
84 }, 84 },
85 info: function(aTo, aNode, aResult, aError) { 85 info: function(aTo, aNode, aResult, aError) {
86 this.send(Lightstring.stanzas.disco.info(aTo, aNode), function(stanza){ 86 this.send(Lightstring.stanzas.disco.info(aTo, aNode), function(stanza) {
87 var identities = []; 87 var identities = [];
88 var features = []; 88 var features = [];
89 var fields = {}; 89 var fields = {};
90 90
91 var children = stanza.DOM.firstChild.childNodes; 91 var children = stanza.DOM.firstChild.childNodes;
123 123
124 if (aResult) 124 if (aResult)
125 aResult(stanza); 125 aResult(stanza);
126 }, aError); 126 }, aError);
127 }, 127 },
128 addFeature: function(feature) { 128 addFeatures: function() {
129 features.push(feature); 129 for (var i = 0; i < arguments.length; i++)
130 features.push(arguments[i]);
130 } 131 }
131 }, 132 },
132 init: function() { 133 init: function() {
133 conn.on('iq/' + Lightstring.ns['disco#info'] + ':query', function(stanza) { 134 conn.on('iq/' + Lightstring.ns['disco#info'] + ':query', function(stanza) {
134 if (stanza.DOM.getAttributeNS(null, 'type') !== 'get') 135 if (stanza.DOM.getAttributeNS(null, 'type') !== 'get')
165 166
166 res += "</query>" + 167 res += "</query>" +
167 "</iq>"; 168 "</iq>";
168 169
169 conn.send(res); 170 conn.send(res);
171 return true;
170 }); 172 });
171 } 173 }
172 }; 174 };
173 })(); 175 })();