# HG changeset patch # User Waqas Hussain # Date 1266756469 -18000 # Node ID 2045d13ba01837e92fd06086fef536e81171561e # Parent 837e697562ad9ce9e3e0acf61de6d707731d8352# Parent d0d38fcaade0cb187e2c72add57e1e410890be85 Merge with 0.7. diff -r 837e697562ad -r 2045d13ba018 core/stanza_router.lua --- a/core/stanza_router.lua Sat Feb 20 00:53:04 2010 +0000 +++ b/core/stanza_router.lua Sun Feb 21 17:47:49 2010 +0500 @@ -140,6 +140,7 @@ to_type = '/host'; else to_type = '/bare'; + to_self = true; end end diff -r 837e697562ad -r 2045d13ba018 plugins/mod_iq.lua --- a/plugins/mod_iq.lua Sat Feb 20 00:53:04 2010 +0000 +++ b/plugins/mod_iq.lua Sun Feb 21 17:47:49 2010 +0500 @@ -53,6 +53,18 @@ end end); +module:hook("iq/self", function(data) + -- IQ to bare JID recieved + local origin, stanza = data.origin, data.stanza; + + if stanza.attr.type == "get" or stanza.attr.type == "set" then + return module:fire_event("iq/self/"..stanza.tags[1].attr.xmlns..":"..stanza.tags[1].name, data); + else + module:fire_event("iq/self/"..stanza.attr.id, data); + return true; + end +end); + module:hook("iq/host", function(data) -- IQ to a local host recieved local origin, stanza = data.origin, data.stanza;