diff options
author | Waqas Hussain <waqas20@gmail.com> | 2009-05-15 23:42:35 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2009-05-15 23:42:35 +0500 |
commit | b394dc91559d46748767fa49db62a7495fea95a9 (patch) | |
tree | 15f8fd9f86744b471ef029fa9e91d033ff9e3173 | |
parent | d836e5c09de5c45af4c76cc8cc66458bc0c5deec (diff) | |
download | prosody-b394dc91559d46748767fa49db62a7495fea95a9.tar.gz prosody-b394dc91559d46748767fa49db62a7495fea95a9.zip |
stanza_router: Fire events after all checks
-rw-r--r-- | core/stanza_router.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/stanza_router.lua b/core/stanza_router.lua index 8f3d2d1f..190a91bd 100644 --- a/core/stanza_router.lua +++ b/core/stanza_router.lua @@ -107,8 +107,6 @@ function core_process_stanza(origin, stanza) end]] -- FIXME if (origin.type == "s2sin" or origin.type == "c2s" or origin.type == "component") and (not xmlns or xmlns == "jabber:server" or xmlns == "jabber:client") then - local event_data = {origin=origin, stanza=stanza}; - if fire_event(tostring(host or origin.host).."/"..stanza.name, event_data) then return; end if origin.type == "s2sin" and not origin.dummy then local host_status = origin.hosts[from_host]; if not host_status or not host_status.authed then -- remote server trying to impersonate some other server? @@ -116,7 +114,10 @@ function core_process_stanza(origin, stanza) return; -- FIXME what should we do here? does this work with subdomains? end end - if not to then + local event_data = {origin=origin, stanza=stanza}; + if fire_event(tostring(host or origin.host).."/"..stanza.name, event_data) then + -- event handled + elseif not to then core_handle_stanza(origin, stanza); elseif hosts[to] and hosts[to].type == "local" then -- directed at a local server core_handle_stanza(origin, stanza); |