# HG changeset patch # User Matthew Wild # Date 1774431058 0 # Node ID fb7902f66c36e35d10099a2b52ea6b2677ddfda0 # Parent 88a8780c949f5cac50e61060eb78b6449959e992 mod_muc_auto_role: Skip processing for users already affiliated with the MUC diff -r 88a8780c949f -r fb7902f66c36 mod_muc_auto_role/mod_muc_auto_role.lua --- a/mod_muc_auto_role/mod_muc_auto_role.lua Tue Mar 24 21:08:47 2026 +0000 +++ b/mod_muc_auto_role/mod_muc_auto_role.lua Wed Mar 25 09:30:58 2026 +0000 @@ -17,6 +17,11 @@ module:hook("muc-occupant-pre-join", function (event) local stanza = event.stanza; + if event.room:get_affiliation(event.occupant.bare_jid) then + -- Skip for already-affiliated users + return; + end + local from_host = jid.host(stanza.attr.from); if untrusted_servers:contains(from_host) then