+ if type == "get" or type == "set" then
+ local child = stanza.tags[1];
+ local ret = module:fire_event("iq/bare/"..child.attr.xmlns..":"..child.name, data);
+ if ret ~= nil then return ret; end
+ return module:fire_event("iq-"..type.."/bare/"..child.attr.xmlns..":"..child.name, data);
+ else
+ return module:fire_event("iq-"..type.."/bare/"..stanza.attr.id, data);
+ end
+end);
+
+module:hook("iq/self", function(data)
+ -- IQ to self JID recieved
+ local origin, stanza = data.origin, data.stanza;
+ local type = stanza.attr.type;
+
+ if type == "get" or type == "set" then
+ local child = stanza.tags[1];
+ local ret = module:fire_event("iq/self/"..child.attr.xmlns..":"..child.name, data);
+ if ret ~= nil then return ret; end
+ return module:fire_event("iq-"..type.."/self/"..child.attr.xmlns..":"..child.name, data);
+ else
+ return module:fire_event("iq-"..type.."/self/"..stanza.attr.id, data);
+ end