diff options
author | Matthew Wild <mwild1@gmail.com> | 2020-02-05 22:53:59 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2020-02-05 22:53:59 +0000 |
commit | 428e4fa83263db49891c64389ba404d819902cb1 (patch) | |
tree | 8647d5d368f59e85e5d5336fb3ac48fbdfeac64f | |
parent | 3827fd9716252e9b74bef848fd39879dd2699950 (diff) | |
download | prosody-428e4fa83263db49891c64389ba404d819902cb1.tar.gz prosody-428e4fa83263db49891c64389ba404d819902cb1.zip |
stanza_router: only fire pre-stanza if firing other preevents (e.g. for c2s sessions)
-rw-r--r-- | core/stanza_router.lua | 12 |
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]; |