# HG changeset patch # User Kim Alvefur # Date 1770463552 -3600 # Node ID 9c9889ad4302190776153446b60ffad579d0b4f5 # Parent 0e7f9ce4768fecf4f9d815ed0a7c4e1cb0c334de 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. diff -r 0e7f9ce4768f -r 9c9889ad4302 mod_unsubscriber/README.md --- a/mod_unsubscriber/README.md Sun Feb 01 14:10:14 2026 +0100 +++ b/mod_unsubscriber/README.md Sat Feb 07 12:25:52 2026 +0100 @@ -1,10 +1,14 @@ -Over the years, some servers stop working for various reasons, and leave -behind broken roster subscriptions that trigger failing s2s connections. +Over the years, some servers stop working for various reasons, and leave behind broken roster subscriptions and dysfunctional group chat bookmarks +that trigger failing s2s connections. Sometimes users make mistakes when adding a contact or group chat, causing your server to make repeated attempts +to connect to a domain with a typo in it. + This module allows cleaning up such cases by unsubscribing local users -from their contacts on those servers. Also works for typos and the like. +from their contacts on those servers. Use with care. -```lua +To use, simply add as a `Component` for each domain you want to stop seeing failed connection logs about. + +``` lua Component "gmail.com" "unsubscriber" modules_disabled = { "s2s" } ``` diff -r 0e7f9ce4768f -r 9c9889ad4302 mod_unsubscriber/mod_unsubscriber.lua --- 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)