From bf4830bc9f51a27aba59bc5708caddb835e84789 Mon Sep 17 00:00:00 2001 From: Alex Clayton Date: Wed, 8 Nov 2017 14:42:11 +0000 Subject: Allow affiliations on full jids Allow affiliations to be set on full jids. This is so we can set affiliations for group (which use full JIDS to identify themselves). Test-information: Works with Gurmeen's group affiliation patch for MLC Change-Id: I74a4977a044bbb4ea031def0072c6c42b7c0c976 diff --git a/src/com/isode/stroke/muc/MUCImpl.java b/src/com/isode/stroke/muc/MUCImpl.java index 26be309..2a45926 100644 --- a/src/com/isode/stroke/muc/MUCImpl.java +++ b/src/com/isode/stroke/muc/MUCImpl.java @@ -106,7 +106,9 @@ public class MUCImpl extends MUC { /** * Change the affiliation of the given Jabber ID. * It must be called with the real JID, not the room JID. - * @param jid real jabber ID, not null + * @param jid real jabber ID, not null. NOTE: This method does not + strip any resource from the JID, as expected by XEP-0045. Callers + wanting to be strictly XEP-0045 conformant should pass in a bare JID * @param affiliation new affiliation, not null */ @Override @@ -114,7 +116,9 @@ public class MUCImpl extends MUC { final MUCAdminPayload mucPayload = new MUCAdminPayload(); MUCItem item = new MUCItem(); item.affiliation = affiliation; - item.realJID = jid.toBare(); + // According to XEP-0045 the JID should be bare, but this isn't being done here because + // to provide support for applications where we do want to set affilations on a per resource basis + item.realJID = jid; mucPayload.addItem(item); GenericRequest request = new GenericRequest( IQ.Type.Set, getJID(), mucPayload, iqRouter_); -- cgit v0.10.2-6-g49f6