Changeset

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
parents 6182:dbf0b09664cd
children 6184:2bfc4b12ec8f
files plugins/muc/muc.lib.lua
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/muc/muc.lib.lua	Fri Mar 28 13:05:36 2014 -0400
+++ b/plugins/muc/muc.lib.lua	Fri Mar 28 13:11:11 2014 -0400
@@ -163,18 +163,18 @@
 function room_mt:build_item_list(occupant, x, is_anonymous, nick, actor, reason)
 	local affiliation = self:get_affiliation(occupant.bare_jid);
 	local role = occupant.role;
-	local actor_jid = actor and self:get_occupant_jid(actor);
+	local actor_attr;
 	if actor then
-		actor = {nick = select(3,jid_split(actor_jid))};
+		actor_attr = {nick = select(3,jid_split(self:get_occupant_jid(actor)))};
 	end
 	if is_anonymous then
-		add_item(x, affiliation, role, nil, nick, actor, reason);
+		add_item(x, affiliation, role, nil, nick, actor_attr, reason);
 	else
-		if actor_jid then
-			actor.jid = actor_jid;
+		if actor_attr then
+			actor_attr.jid = actor;
 		end
 		for real_jid, session in occupant:each_session() do
-			add_item(x, affiliation, role, real_jid, nick, actor, reason);
+			add_item(x, affiliation, role, real_jid, nick, actor_attr, reason);
 		end
 	end
 	return x