diff lightstring.js @ 79:2290321f5c8b

Always having an id on out-iq.
author Sonny Piers <sonny.piers@gmail.com>
date Tue, 07 Feb 2012 18:37:23 +0100
parents 4d0fc1c9ec88
children d9804e206393
line wrap: on
line diff
--- a/lightstring.js
+++ b/lightstring.js
@@ -269,10 +269,10 @@ Lightstring.Connection.prototype = {
       var callback = {success: aSuccess, error: aError};
 
       var id = stanza.DOM.getAttributeNS(null, 'id');
-      if (!id)
-        ; //TODO: warning
-      else
-        this.callbacks[id] = callback;
+      if (!id) {
+        var id = Lightstring.newId('sendiq:');
+        stanza.DOM.setAttributeNS(null, 'id', id);
+      }
 
       this.callbacks[id] = callback;