# HG changeset patch # User Emmanuel Gil Peyrot # Date 1327612586 -3600 # Node ID 99bf2bdcfd96d0e57cda931f5635e93b05a22568 # Parent 6a6bb8ded046ad0483ac6458dc1441a5f61b127a Emit an iq/namespace:tag event for each iq containing a payload. diff --git a/lightstring.js b/lightstring.js --- a/lightstring.js +++ b/lightstring.js @@ -263,8 +263,12 @@ Lightstring.Connection.prototype = { that.emit('DOMInput', elm); that.emit(elm.tagName, elm); - if (elm.tagName === 'iq') + if (elm.tagName === 'iq') { + var payload = elm.firstChild; + if (payload) + that.emit('iq/' + payload.namespaceURI + ':' + payload.localName, elm); that.emit(elm.getAttribute('id'), elm); //FIXME: possible attack vector. + } }); }, /**