diff lightstring.js @ 37:6773e5bc2ca0

several fixes
author Sonny Piers <sonny.piers@gmail.com>
date Mon, 30 Jan 2012 23:46:55 +0100
parents 6ce66fba0242
children 5e32481b8a92
line wrap: on
line diff
--- a/lightstring.js
+++ b/lightstring.js
@@ -328,9 +328,8 @@ Lightstring.Connection.prototype = {
     if (stanza.DOM.tagName === 'iq') {
       var id = stanza.DOM.getAttribute('id');
       //TODO: This should be done by a plugin
-      if (!id) {
+      if (!id)
         stanza.DOM.setAttribute('id', Lightstring.newId('sendiq:'));
-      }
       if (aCallback)
         this.on(stanza.DOM.getAttribute('id'), aCallback);
     }
@@ -340,7 +339,9 @@ Lightstring.Connection.prototype = {
 
 
     //TODO this.socket.send(stanza.XML); (need some work on Lightstring.Stanza)
-    this.socket.send(Lightstring.DOM2XML(stanza.DOM));
+    var fixme = Lightstring.DOM2XML(stanza.DOM);
+    stanza.XML = fixme;
+    this.socket.send(fixme);
     this.emit('output', stanza);
   },
   /**