comparison mod_muc_moderation/mod_muc_moderation.lua @ 4177:a38e6a8a781a

mod_muc_moderation: Improve error message to be more helpful
author Kim Alvefur <zash@zash.se>
date Tue, 06 Oct 2020 18:57:47 +0200
parents 341850e8866f
children 3a7953a5ee5b
comparison
equal deleted inserted replaced
4176:0016618e0975 4177:a38e6a8a781a
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 local role = room:get_role(actor_nick) or room:get_default_role(affiliation); 58 local role = room:get_role(actor_nick) or room:get_default_role(affiliation);
59 if valid_roles[role or "none"] < valid_roles.moderator then 59 if valid_roles[role or "none"] < valid_roles.moderator then
60 origin.send(st.error_reply(stanza, "auth", "forbidden", "Insufficient privileges")); 60 origin.send(st.error_reply(stanza, "auth", "forbidden", "You need a role of at least 'moderator'"));
61 return true; 61 return true;
62 end 62 end
63 63
64 -- Original stanza to base tombstone on 64 -- Original stanza to base tombstone on
65 local original, err; 65 local original, err;