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)
--- a/core/s2smanager.lua Fri Nov 12 13:26:05 2021 +0000
+++ b/core/s2smanager.lua Fri Nov 12 13:30:39 2021 +0000
@@ -101,6 +101,7 @@
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