aboutsummaryrefslogtreecommitdiffstats
path: root/core/s2smanager.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-08-30 04:37:53 +0100
committerMatthew Wild <mwild1@gmail.com>2010-08-30 04:37:53 +0100
commit8bbe120e4b0665cc00413a8816bb06cd904e80d7 (patch)
tree563f4291e12e6e56b407bdca628746f78e03e8ce /core/s2smanager.lua
parenta69205c3b9c92f091221a9f7c56dd92a0ee6cac0 (diff)
downloadprosody-8bbe120e4b0665cc00413a8816bb06cd904e80d7.tar.gz
prosody-8bbe120e4b0665cc00413a8816bb06cd904e80d7.zip
s2smanager: Fire s2s{in,out}-established when new s2s connections are ready
Diffstat (limited to 'core/s2smanager.lua')
-rw-r--r--core/s2smanager.lua11
1 files changed, 10 insertions, 1 deletions
diff --git a/core/s2smanager.lua b/core/s2smanager.lua
index 88d6a796..39cce309 100644
--- a/core/s2smanager.lua
+++ b/core/s2smanager.lua
@@ -47,8 +47,9 @@ local max_dns_depth = config.get("*", "core", "dns_max_depth") or 3;
dns.settimeout(dns_timeout);
+local prosody = _G.prosody;
incoming_s2s = {};
-_G.prosody.incoming_s2s = incoming_s2s;
+prosody.incoming_s2s = incoming_s2s;
local incoming_s2s = incoming_s2s;
module "s2smanager"
@@ -516,6 +517,14 @@ function mark_connected(session)
local send_to_host = send_to_host;
function session.send(data) send_to_host(to, from, data); end
+ local event_data = { session = session };
+ if session.type == "s2sout" then
+ prosody.events.fire_event("s2sout-established", event_data);
+ hosts[session.from_host].events.fire_event("s2sout-established", event_data);
+ else
+ prosody.events.fire_event("s2sin-established", event_data);
+ hosts[session.to_host].events.fire_event("s2sin-established", event_data);
+ end
if session.direction == "outgoing" then
if sendq then