# HG changeset patch # User Sonny Piers # Date 1328547786 -3600 # Node ID 7854e036a5723e413405f13f62d9b02b8b5a8c0a # Parent 0b8e7ca19f836ea73649ba502c200c9c3620433c Fix a problem that made events without data called only once. diff --git a/lightstring.js b/lightstring.js --- a/lightstring.js +++ b/lightstring.js @@ -334,6 +334,15 @@ Lightstring.Connection.prototype = { if (!handlers) return; + //No data events + if(!aData) { + for (var i = 0; i < handlers.length; i++) + handlers[i].call(this, aData); + + return; + } + + //Non-iq events if (aData && aData.DOM && aData.DOM.localName !== 'iq') { for (var i = 0; i < handlers.length; i++) handlers[i].call(this, aData); @@ -341,6 +350,7 @@ Lightstring.Connection.prototype = { return; } + //Iq events var ret; for (var i = 0; i < handlers.length; i++) { ret = handlers[i].call(this, aData);