Compare commits

...

2 Commits

Author SHA1 Message Date
damencho
62f06bc418 squash: Simplify rules. 2024-04-23 10:59:43 -05:00
damencho
8a2379077f feat: Log when affiliation is missing in admin set command.
An error for indexing nil we observe.
2024-04-23 08:13:15 -05:00

View File

@@ -133,6 +133,12 @@ function filter_admin_set_query(event)
local room = get_room_from_jid(room_jid);
local item = stanza.tags[1].tags[1];
if not item then
module:log('error', 'Error unexpected stanza: %s', stanza);
return true;
end
local _aff = item.attr.affiliation;
-- if it is a moderated room we skip it
@@ -141,7 +147,7 @@ function filter_admin_set_query(event)
end
-- any revoking is disabled, everyone should be owners
if _aff == 'none' or _aff == 'outcast' or _aff == 'member' then
if _aff and _aff ~= 'owner' then
origin.send(st.error_reply(stanza, "auth", "forbidden"));
return true;
end