# HG changeset patch # User Matthew Wild # Date 1540134294 -3600 # Node ID 3bc5c22e2ca49562b2bc19a7d259a1c26952dc39 # Parent 6a1e7723208b8c7e5c7ba7fd2b27642f3b0beae6 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. diff -r 6a1e7723208b -r 3bc5c22e2ca4 plugins/muc/muc.lib.lua --- a/plugins/muc/muc.lib.lua Sun Oct 21 15:38:55 2018 +0100 +++ b/plugins/muc/muc.lib.lua Sun Oct 21 16:04:54 2018 +0100 @@ -922,7 +922,7 @@ 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:get_occupant_by_nick(self.jid.."/"..item.attr.nick); - if occupant then item.attr.jid = occupant.jid; end + if occupant then item.attr.jid = occupant.bare_jid; end elseif item.attr.role and not item.attr.nick and item.attr.jid then -- Role changes should use nick, but we have a JID so pull the nick from that local nick = self:get_occupant_jid(item.attr.jid); diff -r 6a1e7723208b -r 3bc5c22e2ca4 spec/scansion/issue1224.scs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/spec/scansion/issue1224.scs Sun Oct 21 16:04:54 2018 +0100 @@ -0,0 +1,108 @@ +# MUC: Room registration and reserved nicknames + +[Client] Romeo + jid: user@localhost + password: password + +[Client] Juliet + jid: user2@localhost + password: password + +----- + +Romeo connects + +Romeo sends: + + + + +Romeo receives: + + + + + + + + +Romeo receives: + + +# Submit config form +Romeo sends: + + + + + http://jabber.org/protocol/muc#roomconfig + + + + + +Romeo receives: + + + +Romeo sends: + + + + + + +Romeo receives: + + +# Juliet connects, and joins the room +Juliet connects + +Juliet sends: + + + + +Juliet receives: + + +Juliet receives: + + +Juliet receives: + + +Romeo receives: + + +# Romeo makes Juliet a member of the room, however his client is buggy and only +# specifies her nickname + +Romeo sends: + + + + + + +Romeo receives: + + + + + + + + +Romeo receives: + + +Juliet receives: + + + + + + + +