diff options
author | Waqas Hussain <waqas20@gmail.com> | 2009-05-31 02:20:30 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2009-05-31 02:20:30 +0500 |
commit | 4841e267c503cf5b153f5fb5d19892a629cedeb7 (patch) | |
tree | c1962006e2274ef538a9dccacb5d3faeb1cd7250 /core | |
parent | 25a09a4d954336ff41459e4aaefe205fb00c5171 (diff) | |
download | prosody-4841e267c503cf5b153f5fb5d19892a629cedeb7.tar.gz prosody-4841e267c503cf5b153f5fb5d19892a629cedeb7.zip |
stanza_router: Fire events for non-jabber:client and pre-auth stanzas
Diffstat (limited to 'core')
-rw-r--r-- | core/stanza_router.lua | 14 |
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 |