comparison lightstring.js @ 57:91f18fdc0e2c

Some clean up.
author Sonny Piers <sonny.piers@gmail.com>
date Wed, 01 Feb 2012 16:48:48 +0100
parents 1d4b844586f6
children bbcc6bbdac73
comparison
equal deleted inserted replaced
56:1d4b844586f6 57:91f18fdc0e2c
81 var XML = null; 81 var XML = null;
82 try { 82 try {
83 XML = this.serializer.serializeToString(aElement); 83 XML = this.serializer.serializeToString(aElement);
84 } 84 }
85 catch (e) { 85 catch (e) {
86 alert(e); 86 //TODO throw error
87 } 87 }
88 finally { 88 finally {
89 return XML; 89 return XML;
90 }; 90 };
91 }, 91 },
302 //TODO node-xmpp-bosh sends a self-closing stream:stream tag; it is wrong! 302 //TODO node-xmpp-bosh sends a self-closing stream:stream tag; it is wrong!
303 that.emit('input', stanza); 303 that.emit('input', stanza);
304 304
305 if(!stanza.DOM) 305 if(!stanza.DOM)
306 return; 306 return;
307 307
308 that.emit(stanza.DOM.tagName, stanza); 308 that.emit(stanza.DOM.tagName, stanza);
309 309
310 if (stanza.DOM.tagName === 'iq') { 310 if (stanza.DOM.tagName === 'iq') {
311 var payload = stanza.DOM.firstChild; 311 var payload = stanza.DOM.firstChild;
312 if (payload) 312 if (payload)
403 //Handlers 403 //Handlers
404 for (var handler in plugin.handlers) 404 for (var handler in plugin.handlers)
405 this.on(handler, plugin.handlers[handler]); 405 this.on(handler, plugin.handlers[handler]);
406 406
407 //Methods 407 //Methods
408 this[name] = {}: 408 this[name] = {};
409 for (var method in plugins.methods) 409 for (var method in plugins.methods)
410 this[name][method].bind(this); 410 this[name][method].bind(this);
411 411
412 if (plugin.init) 412 if (plugin.init)
413 plugin.init(); 413 plugin.init();