changeset 6559:228859ea4781

mod_muc_members_json: do not automatically unban entities This would otherwise serve to evade temporary bans.
author Jonas Schäfer <jonas@wielicki.name>
date Sat, 06 Jun 2026 08:40:31 +0200
parents 15a7749c7acb
children 7dee00093c88
files mod_muc_members_json/mod_muc_members_json.lua
diffstat 1 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mod_muc_members_json/mod_muc_members_json.lua	Sun May 24 20:07:30 2026 +0100
+++ b/mod_muc_members_json/mod_muc_members_json.lua	Sat Jun 06 08:40:31 2026 +0200
@@ -117,12 +117,16 @@
 									local expected_affiliation = (is_owner and "owner") or (is_admin and "admin") or "member";
 									local affiliation = muc:get_affiliation(member_jid);
 									if affiliation ~= expected_affiliation then
-										if not dry_run then
-											muc:set_affiliation(true, member_jid, expected_affiliation, "imported membership");
-											muc:set_affiliation_data(member_jid, "source", module.name);
-											module:log("info", "Set affiliation of %s in %s, %s -> %s", member_jid, muc_jid, affiliation, expected_affiliation);
+										if affiliation == "outcast" then
+											module:log("debug", "Not updating affiliation of %s in %s, because they are currently outcast", member_jid, muc_jid);
 										else
-											module:log("info", "DRY RUN: Would set affiliation of %s in %s, %s -> %s", member_jid, muc_jid, affiliation, expected_affiliation);
+											if not dry_run then
+												muc:set_affiliation(true, member_jid, expected_affiliation, "imported membership");
+												muc:set_affiliation_data(member_jid, "source", module.name);
+												module:log("info", "Set affiliation of %s in %s, %s -> %s", member_jid, muc_jid, affiliation, expected_affiliation);
+											else
+												module:log("info", "DRY RUN: Would set affiliation of %s in %s, %s -> %s", member_jid, muc_jid, affiliation, expected_affiliation);
+											end
 										end
 									end
 									if not dry_run then