aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-05-31 21:35:21 +0100
committerMatthew Wild <mwild1@gmail.com>2009-05-31 21:35:21 +0100
commit00f019739ad6aeae86528b62505f44b4037ac113 (patch)
treed3b2bdfc170f821cc35444ad1b437e16c63408c3
parentdef151d5ee2d98985890613641120ee9d63df129 (diff)
downloadprosody-00f019739ad6aeae86528b62505f44b4037ac113.tar.gz
prosody-00f019739ad6aeae86528b62505f44b4037ac113.zip
stanza_router: Fire global event if host doesn't have events, fixes #103
-rw-r--r--core/stanza_router.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/stanza_router.lua b/core/stanza_router.lua
index 4ade0055..207302c7 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,7 +163,7 @@ 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);