Mercurial > prosody-hg
comparison plugins/muc/muc.lib.lua @ 6269:f89d2dec2977
plugins/muc/muc.lib: Fix incorrect whois logic (thanks mva)
| author | daurnimator <quae@daurnimator.com> |
|---|---|
| date | Sun, 01 Jun 2014 15:40:04 -0400 |
| parents | 23cb8a78ecc6 |
| children | 90054f21d1af |
comparison
equal
deleted
inserted
replaced
| 6268:23cb8a78ecc6 | 6269:f89d2dec2977 |
|---|---|
| 250 end | 250 end |
| 251 end | 251 end |
| 252 | 252 |
| 253 function room_mt:send_occupant_list(to, filter) | 253 function room_mt:send_occupant_list(to, filter) |
| 254 local to_bare = jid_bare(to); | 254 local to_bare = jid_bare(to); |
| 255 local is_anonymous = true; | 255 local is_anonymous = false; |
| 256 local whois = self:get_whois(); | 256 local whois = self:get_whois(); |
| 257 if whois ~= "anyone" then | 257 if whois ~= "anyone" then |
| 258 local affiliation = self:get_affiliation(to); | 258 local affiliation = self:get_affiliation(to); |
| 259 if affiliation ~= "admin" and affiliation ~= "owner" then | 259 if affiliation ~= "admin" and affiliation ~= "owner" then |
| 260 local occupant = self:get_occupant_by_real_jid(to); | 260 local occupant = self:get_occupant_by_real_jid(to); |
| 261 if not occupant or can_see_real_jids(whois, occupant) then | 261 if not (occupant and can_see_real_jids(whois, occupant)) then |
| 262 is_anonymous = false; | 262 is_anonymous = true; |
| 263 end | 263 end |
| 264 end | 264 end |
| 265 end | 265 end |
| 266 for occupant_jid, occupant in self:each_occupant() do | 266 for occupant_jid, occupant in self:each_occupant() do |
| 267 if filter == nil or filter(occupant_jid, occupant) then | 267 if filter == nil or filter(occupant_jid, occupant) then |
