553 local from, to = session.from_host, session.to_host; |
553 local from, to = session.from_host, session.to_host; |
554 |
554 |
555 session.log("info", session.direction.." s2s connection "..from.."->"..to.." complete"); |
555 session.log("info", session.direction.." s2s connection "..from.."->"..to.." complete"); |
556 |
556 |
557 local send_to_host = send_to_host; |
557 local send_to_host = send_to_host; |
558 function session.send(data) send_to_host(to, from, data); end |
558 function session.send(data) return send_to_host(to, from, data); end |
559 |
559 |
560 local event_data = { session = session }; |
560 local event_data = { session = session }; |
561 if session.type == "s2sout" then |
561 if session.type == "s2sout" then |
562 prosody.events.fire_event("s2sout-established", event_data); |
562 prosody.events.fire_event("s2sout-established", event_data); |
563 hosts[session.from_host].events.fire_event("s2sout-established", event_data); |
563 hosts[session.from_host].events.fire_event("s2sout-established", event_data); |