# HG changeset patch # User Matthew Wild # Date 1774432042 0 # Node ID 5a01db53d6803b1afe3dc1038e19bacd9c15027f # Parent fb7902f66c36e35d10099a2b52ea6b2677ddfda0 mod_muc_auto_role: Also restrict default role assignment to unaffiliated JIDs diff -r fb7902f66c36 -r 5a01db53d680 mod_muc_auto_role/mod_muc_auto_role.lua --- a/mod_muc_auto_role/mod_muc_auto_role.lua Wed Mar 25 09:30:58 2026 +0000 +++ b/mod_muc_auto_role/mod_muc_auto_role.lua Wed Mar 25 09:47:22 2026 +0000 @@ -10,8 +10,10 @@ local default_role = module:get_option_enum("muc_default_role", "visitor", "participant"); -- TODO: This should be a config option in mod_muc -module:hook("muc-get-default-role", function () - return default_role; +module:hook("muc-get-default-role", function (event) + if (event.affiliation or "none") == "none" then + return default_role; + end end, 5); module:hook("muc-occupant-pre-join", function (event)