diff mod_unsubscriber/mod_unsubscriber.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 e00dc913d965
children
line wrap: on
line diff
--- a/mod_unsubscriber/mod_unsubscriber.lua	Sun Feb 01 14:10:14 2026 +0100
+++ b/mod_unsubscriber/mod_unsubscriber.lua	Sat Feb 07 12:25:52 2026 +0100
@@ -12,6 +12,13 @@
 		origin.send(reply);
 		return true;
 	elseif stanza.attr.type == nil then
+		if stanza:get_child("x", "http://jabber.org/protocol/muc") then
+			-- attempting to join a MUC
+			-- tell them it's gone
+			local reply = st.error_reply(stanza, "cancel", "gone");
+			origin.send(reply);
+			return true;
+		end
 		-- they think we are subscribed and sent their current presence
 		-- tell them we unsubscribe
 		local reply = st.reply(stanza)