Diff

plugins/mod_s2s/mod_s2s.lua @ 10248:d7cadd118053

mod_s2s: Insert s2sin into outgoing routing table when bidirectional
author Kim Alvefur <zash@zash.se>
date Sat, 07 Sep 2019 18:33:16 +0200
parent 10247:5de65f30fe5e
child 10249:790c6ae54dd6
line wrap: on
line diff
--- a/plugins/mod_s2s/mod_s2s.lua	Sat Sep 07 18:32:29 2019 +0200
+++ b/plugins/mod_s2s/mod_s2s.lua	Sat Sep 07 18:33:16 2019 +0200
@@ -216,6 +216,10 @@
 		end
 
 	else
+		if session.outgoing and not hosts[to].s2sout[from] then
+			session.log("debug", "Setting up to handle route from %s to %s", to, from);
+			hosts[to].s2sout[from] = session; -- luacheck: ignore 122
+		end
 		local host_session = hosts[to];
 		session.send = function(stanza)
 			return host_session.events.fire_event("route/remote", { from_host = to, to_host = from, stanza = stanza });