core/s2smanager.lua

changeset 3476
193bb0936a4e
parent 3459
543f31cdde19
child 3488
4f3fc5f9d944
--- 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

mercurial