plugins/groupchat.lua

changeset 46
1f0fa4af29b8
parent 45
aa797b0a98e7
child 56
cb7656ee4dd8
--- a/plugins/groupchat.lua	Sat Nov 13 20:24:45 2010 +0100
+++ b/plugins/groupchat.lua	Sat Nov 13 21:27:01 2010 +0100
@@ -80,6 +80,15 @@
 					jid = presence.stanza.attr.from;
 					presence = presence.stanza;
 				};
+				local x = presence.stanza:get_child("x", xmlns_muc .. "#user");
+				if x then
+					local x_item = x:get_child("item");
+					if x_item and x_item.attr then
+						occupants[nick].real_jid    = x_item.attr.jid;
+						occupants[nick].affiliation = x_item.attr.affiliation;
+						occupants[nick].role        = x_item.attr.role;
+					end
+				end
 				if nick == room.nick then
 					room.bot:event("groupchat/joined", room);
 				else

mercurial