Mercurial > prosody-hg
diff plugins/muc/moderated.lib.lua @ 8857:f4cc818db995
MUC: Get acting occupant into a local variable for easier access
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Fri, 01 Jun 2018 10:20:19 +0200 |
| parents | 5cd7813d4e94 |
| children | 2096742859c1 |
line wrap: on
line diff
--- a/plugins/muc/moderated.lib.lua Fri Jun 01 09:16:24 2018 +0200 +++ b/plugins/muc/moderated.lib.lua Fri Jun 01 10:20:19 2018 +0200 @@ -68,8 +68,9 @@ module:hook("muc-voice-response", function(event) local actor = event.stanza.attr.from; local affected_occupant = event.room:get_occupant_by_real_jid(event.fields["muc#jid"]); + local occupant = event.occupant; - if event.occupant.role ~= "moderator" then + if occupant.role ~= "moderator" then return; end
