aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/stanza_router.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/stanza_router.lua b/core/stanza_router.lua
index b2712b2f..774c077e 100644
--- a/core/stanza_router.lua
+++ b/core/stanza_router.lua
@@ -174,13 +174,13 @@ function core_post_stanza(origin, stanza, preevents)
local event_data = {origin=origin, stanza=stanza, to_self=to_self};
- local result = hosts[origin.host].events.fire_event("pre-stanza", event_data);
- if result ~= nil then
- log("debug", "Stanza rejected by pre-stanza handler: %s", event_data.reason or "unknown reason");
- return;
- end
-
if preevents then -- c2s connection
+ local result = hosts[origin.host].events.fire_event("pre-stanza", event_data);
+ if result ~= nil then
+ log("debug", "Stanza rejected by pre-stanza handler: %s", event_data.reason or "unknown reason");
+ return;
+ end
+
if hosts[origin.host].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];