From a1067595c6f33be3ff91907a18daa66c5ee3967f Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Thu, 18 Feb 2010 14:28:52 +0500 Subject: MUC: Allow role changes based on JIDs. (transplanted from a4879b1e6cde5aedb6bd5827d710b6dba5e8a736) --- plugins/muc/muc.lib.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua index ad45bbfd..e6f459ae 100644 --- a/plugins/muc/muc.lib.lua +++ b/plugins/muc/muc.lib.lua @@ -514,6 +514,9 @@ function room_mt:handle_to_room(origin, stanza) -- presence changes and groupcha if not item.attr.jid and item.attr.nick then -- COMPAT Workaround for Miranda sending 'nick' instead of 'jid' when changing affiliation local occupant = self._occupants[self.jid.."/"..item.attr.nick]; if occupant then item.attr.jid = occupant.jid; end + elseif not item.attr.nick and item.attr.jid then + local nick = self._jid_nick[item.attr.jid]; + if nick then item.attr.nick = select(3, jid_split(nick)); end end local reason = item.tags[1] and item.tags[1].name == "reason" and #item.tags[1] == 1 and item.tags[1][1]; if item.attr.affiliation and item.attr.jid and not item.attr.role then -- cgit v1.2.3