Comparison

plugins/muc/muc.lib.lua @ 6827:19c4532946b3

MUC: Fix traceback in request for MUC affiliation lists by non-affiliated (thanks Lance)
author Kim Alvefur <zash@zash.se>
date Tue, 15 Sep 2015 19:39:57 +0200
parent 6801:5032d4817a30
child 6828:9019bc4c9a5a
comparison
equal deleted inserted replaced
6826:17a4e89a4780 6827:19c4532946b3
760 local _aff_rank = valid_affiliations[_aff or "none"]; 760 local _aff_rank = valid_affiliations[_aff or "none"];
761 local _rol = item.attr.role; 761 local _rol = item.attr.role;
762 if _aff and _aff_rank and not _rol then 762 if _aff and _aff_rank and not _rol then
763 -- You need to be at least an admin, and be requesting info about your affifiliation or lower 763 -- You need to be at least an admin, and be requesting info about your affifiliation or lower
764 -- e.g. an admin can't ask for a list of owners 764 -- e.g. an admin can't ask for a list of owners
765 local affiliation_rank = valid_affiliations[affiliation]; 765 local affiliation_rank = valid_affiliations[affiliation or "none"];
766 if affiliation_rank >= valid_affiliations.admin and affiliation_rank >= _aff_rank then 766 if affiliation_rank >= valid_affiliations.admin and affiliation_rank >= _aff_rank then
767 local reply = st.reply(stanza):query("http://jabber.org/protocol/muc#admin"); 767 local reply = st.reply(stanza):query("http://jabber.org/protocol/muc#admin");
768 for jid in self:each_affiliation(_aff or "none") do 768 for jid in self:each_affiliation(_aff or "none") do
769 reply:tag("item", {affiliation = _aff, jid = jid}):up(); 769 reply:tag("item", {affiliation = _aff, jid = jid}):up();
770 end 770 end