aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-09-05 12:13:49 +0100
committerMatthew Wild <mwild1@gmail.com>2010-09-05 12:13:49 +0100
commitfa3d0fcbba7109d98b4670aab3a6e43412bf1513 (patch)
treec2cc4fe200dd3cbf824ad67f820c56b001c8c284 /core
parent129b52698c1be058a1eed36ff972936cec99fa85 (diff)
downloadprosody-fa3d0fcbba7109d98b4670aab3a6e43412bf1513.tar.gz
prosody-fa3d0fcbba7109d98b4670aab3a6e43412bf1513.zip
s2smanager: Fire s2s{in,out}-destroyed when s2s connections are destroyed
Diffstat (limited to 'core')
-rw-r--r--core/s2smanager.lua13
1 files changed, 13 insertions, 0 deletions
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