From fa3d0fcbba7109d98b4670aab3a6e43412bf1513 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sun, 5 Sep 2010 12:13:49 +0100 Subject: s2smanager: Fire s2s{in,out}-destroyed when s2s connections are destroyed --- core/s2smanager.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/s2smanager.lua b/core/s2smanager.lua index 39cce309..8705633d 100644 --- a/core/s2smanager.lua +++ b/core/s2smanager.lua @@ -576,6 +576,19 @@ function destroy_session(session, reason) incoming_s2s[session] = nil; end + local event_data = { session = session, reason = reason }; + if session.type == "s2sout" then + prosody.events.fire_event("s2sout-destroyed", event_data); + if hosts[session.from_host] then + hosts[session.from_host].events.fire_event("s2sout-destroyed", event_data); + end + else + prosody.events.fire_event("s2sin-destroyed", event_data); + if hosts[session.to_host] then + hosts[session.to_host].events.fire_event("s2sin-destroyed", event_data); + end + end + retire_session(session); -- Clean session until it is GC'd end -- cgit v1.2.3