# HG changeset patch # User Kim Alvefur # Date 1545601943 -3600 # Node ID 9be9dd434813013b0426fda005a80c2f001b6e99 # Parent 1534d0715d354ee2de9bbdddb59227c3f719becc mod_muc_limits: Simplify bypass for affiliated users Fixes affiliation check for service admins which are always owners but not listed in `room._affiliations` diff -r 1534d0715d35 -r 9be9dd434813 mod_muc_limits/mod_muc_limits.lua --- a/mod_muc_limits/mod_muc_limits.lua Sun Dec 23 21:46:06 2018 +0100 +++ b/mod_muc_limits/mod_muc_limits.lua Sun Dec 23 22:52:23 2018 +0100 @@ -31,8 +31,7 @@ local room = event.room or rooms[dest_room.."@"..dest_host]; if not room then return; end local from_jid = stanza.attr.from; - local occupant = room._occupants[room._jid_nick[from_jid]]; - if (occupant and occupant.affiliation) or (not(occupant) and room._affiliations[jid_bare(from_jid)]) then + if room:get_affiliation(jid_bare(from_jid)) then module:log("debug", "Skipping stanza from affiliated user..."); return; elseif dest_nick and max_nick_length and stanza.name == "presence" and not room._occupants[stanza.attr.to] and #dest_nick > max_nick_length then