Mercurial > prosody-hg
diff plugins/muc/register.lib.lua @ 10225:9bdd9b6bf362
MUC: Simplify nickname refresh loop
Affiliation data is passed as a loop variable so no need to retrieve it
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 25 Aug 2019 21:31:04 +0200 |
| parents | 2d71040a959f |
| children | dab2a7a82170 |
line wrap: on
line diff
--- a/plugins/muc/register.lib.lua Sun Aug 25 20:22:35 2019 +0200 +++ b/plugins/muc/register.lib.lua Sun Aug 25 21:31:04 2019 +0200 @@ -15,8 +15,7 @@ end module:log("debug", "Refreshing reserved nicks..."); local reserved_nicks = {}; - for jid in room:each_affiliation() do - local data = room._affiliation_data[jid]; + for jid, _, data in room:each_affiliation() do local nick = data and data.reserved_nickname; module:log("debug", "Refreshed for %s: %s", jid, nick); if nick then
