mod_s2s: Add function to send replies on s2sout connections that support incoming traffic
--- a/plugins/mod_s2s/mod_s2s.lua Sat Sep 07 17:44:57 2019 +0200
+++ b/plugins/mod_s2s/mod_s2s.lua Sat Sep 07 18:32:29 2019 +0200
@@ -208,6 +208,13 @@
if session.type == "s2sout" then
fire_global_event("s2sout-established", event_data);
hosts[from].events.fire_event("s2sout-established", event_data);
+
+ if session.incoming then
+ session.send = function(stanza)
+ return hosts[from].events.fire_event("route/remote", { from_host = from, to_host = to, stanza = stanza });
+ end;
+ end
+
else
local host_session = hosts[to];
session.send = function(stanza)