Software /
code /
prosody
Comparison
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 |
parent | 8854:5cd7813d4e94 |
child | 8858:2096742859c1 |
comparison
equal
deleted
inserted
replaced
8856:538bb632a2b6 | 8857:f4cc818db995 |
---|---|
66 end); | 66 end); |
67 | 67 |
68 module:hook("muc-voice-response", function(event) | 68 module:hook("muc-voice-response", function(event) |
69 local actor = event.stanza.attr.from; | 69 local actor = event.stanza.attr.from; |
70 local affected_occupant = event.room:get_occupant_by_real_jid(event.fields["muc#jid"]); | 70 local affected_occupant = event.room:get_occupant_by_real_jid(event.fields["muc#jid"]); |
71 local occupant = event.occupant; | |
71 | 72 |
72 if event.occupant.role ~= "moderator" then | 73 if occupant.role ~= "moderator" then |
73 return; | 74 return; |
74 end | 75 end |
75 | 76 |
76 if not event.fields["muc#request_allow"] then | 77 if not event.fields["muc#request_allow"] then |
77 return; | 78 return; |