Comparison

plugins/muc/muc.lib.lua @ 6183:a8e777a19816

plugins/muc/muc.lib: Fix sending occupant jid instead of real jid in <item/> actor
author daurnimator <quae@daurnimator.com>
date Fri, 28 Mar 2014 13:11:11 -0400
parent 6182:dbf0b09664cd
child 6184:2bfc4b12ec8f
comparison
equal deleted inserted replaced
6182:dbf0b09664cd 6183:a8e777a19816
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