aboutsummaryrefslogtreecommitdiffstats
path: root/core/stanza_router.lua
diff options
context:
space:
mode:
Diffstat (limited to 'core/stanza_router.lua')
-rw-r--r--core/stanza_router.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/core/stanza_router.lua b/core/stanza_router.lua
index d03ff97a..4ade0055 100644
--- a/core/stanza_router.lua
+++ b/core/stanza_router.lua
@@ -115,6 +115,20 @@ function core_process_stanza(origin, stanza)
end
core_post_stanza(origin, stanza);
else
+ local h = hosts[stanza.attr.to or origin.host or origin.to_host];
+ if h then
+ local event;
+ if stanza.attr.xmlns == "jabber:client" then
+ if stanza.name == "iq" and (stanza.attr.type == "set" or stanza.attr.type == "get") then
+ event = "stanza/iq/"..stanza.tags[1].attr.xmlns..":"..stanza.tags[1].name;
+ else
+ event = "stanza/"..stanza.name;
+ end
+ else
+ event = "stanza/"..stanza.attr.xmlns..":"..stanza.name;
+ end
+ if h.events.fire_event(event, {origin = origin, stanza = stanza}) then return; end
+ end
modules_handle_stanza(host or origin.host or origin.to_host, origin, stanza);
end
end