# HG changeset patch # User Kim Alvefur # Date 1631888887 -7200 # Node ID 6f7d6712e250a89dafd61f1518b44c27743dda68 # Parent 2327e03d1f8dfc6a1a4f66cd8c822ff4cac9a538 MUC: Reject full JID in affiliation queries XEP-0045 states: > Affiliations are granted, revoked, and maintained based on the user's > bare JID, not the nick as with roles. Therefore inclusion of a full JID in affiliation queries is invalid. Thanks to Ge0rG and Poezio for discovering this issue. diff -r 2327e03d1f8d -r 6f7d6712e250 plugins/muc/muc.lib.lua --- a/plugins/muc/muc.lib.lua Fri Sep 17 12:42:04 2021 +0200 +++ b/plugins/muc/muc.lib.lua Fri Sep 17 16:28:07 2021 +0200 @@ -1050,6 +1050,9 @@ if not item.attr.jid then origin.send(st.error_reply(stanza, "modify", "jid-malformed")); return true; + elseif jid_resource(item.attr.jid) then + origin.send(st.error_reply(stanza, "modify", "jid-malformed", "Bare JID expected, got full JID")); + return true; end end if item.attr.nick then -- Validate provided nick