mod_snikket_restricted_users: Use event.actor, which is preferred and always present

This commit is contained in:
Matthew Wild 2021-11-09 11:23:49 +00:00
parent 2f997d50b5
commit d47a6ddbc0
1 changed files with 2 additions and 2 deletions

View File

@ -26,13 +26,13 @@ local function load_groups_host(module)
end
module:hook("muc-config-submitted/muc#roomconfig_publicroom", function (event)
if not is_restricted(event.stanza.attr.from) then return; end
if not is_restricted(event.actor) then return; end
-- Don't allow modification of this value by restricted users
return true;
end, 5);
module:hook("muc-config-form", function (event)
if not is_restricted(event.stanza.attr.from) then return; end -- Don't restrict admins
if not is_restricted(event.actor) then return; end -- Don't restrict admins
-- Hide the option from the config form for restricted users
local form = event.form;
for i = #form, 1, -1 do