# HG changeset patch # User Matthew Wild # Date 1283139473 -3600 # Node ID 193bb0936a4eeae1c29275c3f00b605716cb6f0a # Parent 0307a3ac3885ed3d45c0bfd426c7863bfee30901 s2smanager: Fire s2s{in,out}-established when new s2s connections are ready diff -r 0307a3ac3885 -r 193bb0936a4e core/s2smanager.lua --- a/core/s2smanager.lua Sun Aug 29 15:07:00 2010 +0100 +++ b/core/s2smanager.lua Mon Aug 30 04:37:53 2010 +0100 @@ -47,8 +47,9 @@ 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 @@ 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