From 4841e267c503cf5b153f5fb5d19892a629cedeb7 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Sun, 31 May 2009 02:20:30 +0500 Subject: stanza_router: Fire events for non-jabber:client and pre-auth stanzas --- core/stanza_router.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'core/stanza_router.lua') 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 -- cgit v1.2.3