aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2021-11-12 13:30:39 +0000
committerMatthew Wild <mwild1@gmail.com>2021-11-12 13:30:39 +0000
commit30ef01a6cceb7e7acdfa9ff0be8733db8fe0dafd (patch)
tree5a84b0f1dc57661ac0d327b6a274c4c27492952b
parent1a64d5d876c401c2002c413d0ecf84c534196f81 (diff)
downloadprosody-30ef01a6cceb7e7acdfa9ff0be8733db8fe0dafd.tar.gz
prosody-30ef01a6cceb7e7acdfa9ff0be8733db8fe0dafd.zip
s2smanager: Fire s2s-destroyed event to mirror s2s-created
The existing events do not fire for unauthed sessions, for example (because the type does not match). I deemed changing their behaviour too risky, and the current behaviour may even be more desirable for some uses. This means we now have roughly paired events: - s2s-created -> s2s-destroyed (global only) - s2sin-established -> s2sin-destroyed (global + host) - s2sout-established -> s2sout-destroyed (global + host)
-rw-r--r--core/s2smanager.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/s2smanager.lua b/core/s2smanager.lua
index 49a5adae..b683e9ca 100644
--- a/core/s2smanager.lua
+++ b/core/s2smanager.lua
@@ -101,6 +101,7 @@ local function destroy_session(session, reason, bounce_reason)
end
local event_data = { session = session, reason = reason };
+ fire_event("s2s-destroyed", event_data);
if session.type == "s2sout" then
fire_event("s2sout-destroyed", event_data);
if hosts[session.from_host] then