aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
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
commit976d6ec54b064a9cc0d8b34cc229f4260e17f2bc (patch)
tree2bc43bcd6c2172e13a45185347db05bae04d9250 /plugins
parentdb40d65ac3025f33b558fadacd68d8dd9e867391 (diff)
downloadprosody-976d6ec54b064a9cc0d8b34cc229f4260e17f2bc.tar.gz
prosody-976d6ec54b064a9cc0d8b34cc229f4260e17f2bc.zip
mod_s2s: Add function to send replies on s2sout connections that support incoming traffic
Diffstat (limited to 'plugins')
-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)