aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_s2s
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2019-09-07 18:32:29 +0200
committerKim Alvefur <zash@zash.se>2019-09-07 18:32:29 +0200
commitf6ba50139a104e69aad9378756b927ccc7b2e661 (patch)
tree2bc43bcd6c2172e13a45185347db05bae04d9250 /plugins/mod_s2s
parent5c27fe4b793490d6ec80cdbdcc5063ae3b660766 (diff)
downloadprosody-f6ba50139a104e69aad9378756b927ccc7b2e661.tar.gz
prosody-f6ba50139a104e69aad9378756b927ccc7b2e661.zip
mod_s2s: Add function to send replies on s2sout connections that support incoming traffic
Diffstat (limited to 'plugins/mod_s2s')
-rw-r--r--plugins/mod_s2s/mod_s2s.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua
index d8e631b9..5114b1ce 100644
--- a/plugins/mod_s2s/mod_s2s.lua
+++ b/plugins/mod_s2s/mod_s2s.lua
@@ -208,6 +208,13 @@ function mark_connected(session)
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)