aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2020-02-05 22:53:59 +0000
committerMatthew Wild <mwild1@gmail.com>2020-02-05 22:53:59 +0000
commit428e4fa83263db49891c64389ba404d819902cb1 (patch)
tree8647d5d368f59e85e5d5336fb3ac48fbdfeac64f /core
parent3827fd9716252e9b74bef848fd39879dd2699950 (diff)
downloadprosody-428e4fa83263db49891c64389ba404d819902cb1.tar.gz
prosody-428e4fa83263db49891c64389ba404d819902cb1.zip
stanza_router: only fire pre-stanza if firing other preevents (e.g. for c2s sessions)
Diffstat (limited to 'core')
-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];