aboutsummaryrefslogtreecommitdiffstats
path: root/core/stanza_router.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-06-01 01:36:42 +0100
committerMatthew Wild <mwild1@gmail.com>2009-06-01 01:36:42 +0100
commitf68d9c8e14dedd4bab4a49b9cc9d818b9cc22c65 (patch)
tree57bb090dfc3a278993148b96bf1832e640c5287a /core/stanza_router.lua
parenta406492eac0743ee7c842defe9622b143992d3da (diff)
parentf87fd81a4a3de75958eb489de371fa6830e48fb2 (diff)
downloadprosody-f68d9c8e14dedd4bab4a49b9cc9d818b9cc22c65.tar.gz
prosody-f68d9c8e14dedd4bab4a49b9cc9d818b9cc22c65.zip
Automated merge with http://waqas.ath.cx:8000/
Diffstat (limited to 'core/stanza_router.lua')
-rw-r--r--core/stanza_router.lua9
1 files changed, 3 insertions, 6 deletions
diff --git a/core/stanza_router.lua b/core/stanza_router.lua
index 4ade0055..58dd820d 100644
--- a/core/stanza_router.lua
+++ b/core/stanza_router.lua
@@ -127,7 +127,7 @@ function core_process_stanza(origin, stanza)
else
event = "stanza/"..stanza.attr.xmlns..":"..stanza.name;
end
- if h.events.fire_event(event, {origin = origin, stanza = stanza}) then return; end
+ if (h.events or prosody.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
@@ -155,7 +155,7 @@ function core_post_stanza(origin, stanza)
local event_data = {origin=origin, stanza=stanza};
if origin.full_jid then -- c2s connection
- if hosts[origin.host].events.fire_event('pre-'..stanza.name..to_type, event_data) then return; end -- do preprocessing
+ if (hosts[origin.host].events or prosody.events).fire_event('pre-'..stanza.name..to_type, event_data) then return; end -- do preprocessing
end
local h = hosts[to_bare] or hosts[host or origin.host];
if h then
@@ -163,11 +163,8 @@ function core_post_stanza(origin, stanza)
component_handle_stanza(origin, stanza);
return;
else
- if h.events.fire_event(stanza.name..to_type, event_data) then return; end -- do processing
+ if (h.events or prosody.events).fire_event(stanza.name..to_type, event_data) then return; end -- do processing
end
- else -- non-local recipient
- core_route_stanza(origin, stanza);
- return;
end
if host and fire_event(host.."/"..stanza.name, event_data) then