161 end |
161 end |
162 -- actor is (real) jid |
162 -- actor is (real) jid |
163 function room_mt:build_item_list(occupant, x, is_anonymous, nick, actor, reason) |
163 function room_mt:build_item_list(occupant, x, is_anonymous, nick, actor, reason) |
164 local affiliation = self:get_affiliation(occupant.bare_jid); |
164 local affiliation = self:get_affiliation(occupant.bare_jid); |
165 local role = occupant.role; |
165 local role = occupant.role; |
166 local actor_jid = actor and self:get_occupant_jid(actor); |
166 local actor_attr; |
167 if actor then |
167 if actor then |
168 actor = {nick = select(3,jid_split(actor_jid))}; |
168 actor_attr = {nick = select(3,jid_split(self:get_occupant_jid(actor)))}; |
169 end |
169 end |
170 if is_anonymous then |
170 if is_anonymous then |
171 add_item(x, affiliation, role, nil, nick, actor, reason); |
171 add_item(x, affiliation, role, nil, nick, actor_attr, reason); |
172 else |
172 else |
173 if actor_jid then |
173 if actor_attr then |
174 actor.jid = actor_jid; |
174 actor_attr.jid = actor; |
175 end |
175 end |
176 for real_jid, session in occupant:each_session() do |
176 for real_jid, session in occupant:each_session() do |
177 add_item(x, affiliation, role, real_jid, nick, actor, reason); |
177 add_item(x, affiliation, role, real_jid, nick, actor_attr, reason); |
178 end |
178 end |
179 end |
179 end |
180 return x |
180 return x |
181 end |
181 end |
182 |
182 |