Diff

plugins/muc/muc.lib.lua @ 6184:2bfc4b12ec8f

plugins/muc/muc.lib: Allow `:send_occupant_list` to have no filter
author daurnimator <quae@daurnimator.com>
date Fri, 28 Mar 2014 13:14:33 -0400
parent 6183:a8e777a19816
child 6185:d4a8840e72f9
line wrap: on
line diff
--- a/plugins/muc/muc.lib.lua	Fri Mar 28 13:11:11 2014 -0400
+++ b/plugins/muc/muc.lib.lua	Fri Mar 28 13:14:33 2014 -0400
@@ -276,7 +276,7 @@
 	local to_occupant = self:get_occupant_by_real_jid(to);
 	local has_anonymous = self:get_whois() ~= "anyone"
 	for occupant_jid, occupant in self:each_occupant() do
-		if filter and filter(occupant_jid, occupant) then
+		if filter == nil or filter(occupant_jid, occupant) then
 			local x = st.stanza("x", {xmlns='http://jabber.org/protocol/muc#user'});
 			local is_anonymous = has_anonymous and occupant.role ~= "moderator" and to_occupant.bare_jid ~= occupant.bare_jid;
 			self:build_item_list(occupant, x, is_anonymous);