Comparison

plugins/muc/muc.lib.lua @ 9530:3bc5c22e2ca4

MUC: Use the bare JID when performing a lookup for COMPAT with clients that don't set it (fixes #1224) The full JID is never meant to be the target of affiliation changes.
author Matthew Wild <mwild1@gmail.com>
date Sun, 21 Oct 2018 16:04:54 +0100
parent 9444:7c1cdf5f9f83
child 9531:f2d70dc13700
comparison
equal deleted inserted replaced
9529:6a1e7723208b 9530:3bc5c22e2ca4
920 end 920 end
921 end 921 end
922 if not item.attr.jid and item.attr.nick then 922 if not item.attr.jid and item.attr.nick then
923 -- COMPAT Workaround for Miranda sending 'nick' instead of 'jid' when changing affiliation 923 -- COMPAT Workaround for Miranda sending 'nick' instead of 'jid' when changing affiliation
924 local occupant = self:get_occupant_by_nick(self.jid.."/"..item.attr.nick); 924 local occupant = self:get_occupant_by_nick(self.jid.."/"..item.attr.nick);
925 if occupant then item.attr.jid = occupant.jid; end 925 if occupant then item.attr.jid = occupant.bare_jid; end
926 elseif item.attr.role and not item.attr.nick and item.attr.jid then 926 elseif item.attr.role and not item.attr.nick and item.attr.jid then
927 -- Role changes should use nick, but we have a JID so pull the nick from that 927 -- Role changes should use nick, but we have a JID so pull the nick from that
928 local nick = self:get_occupant_jid(item.attr.jid); 928 local nick = self:get_occupant_jid(item.attr.jid);
929 if nick then item.attr.nick = jid_resource(nick); end 929 if nick then item.attr.nick = jid_resource(nick); end
930 end 930 end