equal
deleted
inserted
replaced
274 |
274 |
275 function room_mt:send_occupant_list(to, filter) |
275 function room_mt:send_occupant_list(to, filter) |
276 local to_occupant = self:get_occupant_by_real_jid(to); |
276 local to_occupant = self:get_occupant_by_real_jid(to); |
277 local has_anonymous = self:get_whois() ~= "anyone" |
277 local has_anonymous = self:get_whois() ~= "anyone" |
278 for occupant_jid, occupant in self:each_occupant() do |
278 for occupant_jid, occupant in self:each_occupant() do |
279 if filter and filter(occupant_jid, occupant) then |
279 if filter == nil or filter(occupant_jid, occupant) then |
280 local x = st.stanza("x", {xmlns='http://jabber.org/protocol/muc#user'}); |
280 local x = st.stanza("x", {xmlns='http://jabber.org/protocol/muc#user'}); |
281 local is_anonymous = has_anonymous and occupant.role ~= "moderator" and to_occupant.bare_jid ~= occupant.bare_jid; |
281 local is_anonymous = has_anonymous and occupant.role ~= "moderator" and to_occupant.bare_jid ~= occupant.bare_jid; |
282 self:build_item_list(occupant, x, is_anonymous); |
282 self:build_item_list(occupant, x, is_anonymous); |
283 local pres = st.clone(occupant:get_presence()); |
283 local pres = st.clone(occupant:get_presence()); |
284 pres.attr.to = to; |
284 pres.attr.to = to; |