view mod_s2soutinjection/mod_s2soutinjection.lua @ 6398:9c9889ad4302

mod_unsubscriber: Add MUC support This catches XEP-0045 Join stanzas and replies with an error telling the prospective participant that the supposed MUC is gone. The user or their client can then take action to remove any bookmark or at least disable autojoin.
author Kim Alvefur <zash@zash.se>
date Sat, 07 Feb 2026 12:25:52 +0100
parents 4cc3d3de74a7
children
line wrap: on
line source

--% requires: s2sout-pre-connect-event

local basic_resolver = require "net.resolvers.basic";

local injected = module:get_option("s2s_connect_overrides");

module:hook("s2sout-pre-connect", function (event)
	local session = event.session;
	local to_host = session.to_host;
	local inject = injected and injected[to_host];
	if not inject then return end

	local host, port = inject[1] or inject, tonumber(inject[2]) or 5269;
	event.resolver = basic_resolver.new(host, port, "tcp");
end);