Comparison

plugins/muc/muc.lib.lua @ 9612:abf9bacf77d4 0.11

MUC: Clarify condition with parenthesis
author Kim Alvefur <zash@zash.se>
date Fri, 09 Nov 2018 18:40:13 +0100
parent 9599:5a2135964ed3
child 9613:4d7b925652d9
comparison
equal deleted inserted replaced
9611:2700317f93e4 9612:abf9bacf77d4
967 local _rol = item.attr.role; 967 local _rol = item.attr.role;
968 if _aff and _aff_rank and not _rol then 968 if _aff and _aff_rank and not _rol then
969 -- You need to be at least an admin, and be requesting info about your affifiliation or lower 969 -- You need to be at least an admin, and be requesting info about your affifiliation or lower
970 -- e.g. an admin can't ask for a list of owners 970 -- e.g. an admin can't ask for a list of owners
971 local affiliation_rank = valid_affiliations[affiliation or "none"]; 971 local affiliation_rank = valid_affiliations[affiliation or "none"];
972 if affiliation_rank >= valid_affiliations.admin and affiliation_rank >= _aff_rank 972 if (affiliation_rank >= valid_affiliations.admin and affiliation_rank >= _aff_rank)
973 or self:get_members_only() and self:get_whois() == "anyone" and affiliation_rank >= valid_affiliations.member then 973 or (self:get_members_only() and self:get_whois() == "anyone" and affiliation_rank >= valid_affiliations.member) then
974 local reply = st.reply(stanza):query("http://jabber.org/protocol/muc#admin"); 974 local reply = st.reply(stanza):query("http://jabber.org/protocol/muc#admin");
975 for jid in self:each_affiliation(_aff or "none") do 975 for jid in self:each_affiliation(_aff or "none") do
976 local nick = self:get_registered_nick(jid); 976 local nick = self:get_registered_nick(jid);
977 reply:tag("item", {affiliation = _aff, jid = jid, nick = nick }):up(); 977 reply:tag("item", {affiliation = _aff, jid = jid, nick = nick }):up();
978 end 978 end