Changeset

4749:3a7953a5ee5b

mod_muc_moderation: Clarify behavior with a comment
author Kim Alvefur <zash@zash.se>
date Sat, 06 Nov 2021 16:19:38 +0100
parents 4748:a6b94f4fb065
children 4750:98429b646bd4
files mod_muc_moderation/mod_muc_moderation.lua
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_muc_moderation/mod_muc_moderation.lua	Thu Nov 04 20:19:31 2021 +0100
+++ b/mod_muc_moderation/mod_muc_moderation.lua	Sat Nov 06 16:19:38 2021 +0100
@@ -55,6 +55,8 @@
 	local actor = stanza.attr.from;
 	local actor_nick = room:get_occupant_jid(actor);
 	local affiliation = room:get_affiliation(actor);
+	-- Retrieve their current role, iff they are in the room, otherwise what they
+	-- would have based on affiliation.
 	local role = room:get_role(actor_nick) or room:get_default_role(affiliation);
 	if valid_roles[role or "none"] < valid_roles.moderator then
 		origin.send(st.error_reply(stanza, "auth", "forbidden", "You need a role of at least 'moderator'"));