Comparison

mod_muc_moderation/mod_muc_moderation.lua @ 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
parent 4177:a38e6a8a781a
child 4750:98429b646bd4
comparison
equal deleted inserted replaced
4748:a6b94f4fb065 4749:3a7953a5ee5b
53 53
54 -- Permissions 54 -- Permissions
55 local actor = stanza.attr.from; 55 local actor = stanza.attr.from;
56 local actor_nick = room:get_occupant_jid(actor); 56 local actor_nick = room:get_occupant_jid(actor);
57 local affiliation = room:get_affiliation(actor); 57 local affiliation = room:get_affiliation(actor);
58 -- Retrieve their current role, iff they are in the room, otherwise what they
59 -- would have based on affiliation.
58 local role = room:get_role(actor_nick) or room:get_default_role(affiliation); 60 local role = room:get_role(actor_nick) or room:get_default_role(affiliation);
59 if valid_roles[role or "none"] < valid_roles.moderator then 61 if valid_roles[role or "none"] < valid_roles.moderator then
60 origin.send(st.error_reply(stanza, "auth", "forbidden", "You need a role of at least 'moderator'")); 62 origin.send(st.error_reply(stanza, "auth", "forbidden", "You need a role of at least 'moderator'"));
61 return true; 63 return true;
62 end 64 end