summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Clayton <alex.clayton@isode.com>2017-11-08 14:42:11 (GMT)
committerAlex Clayton <alex.clayton@isode.com>2017-11-15 09:49:21 (GMT)
commitbf4830bc9f51a27aba59bc5708caddb835e84789 (patch)
tree290f32d5d70112f977bed17eff366a858bd3f298
parent329d7f7cf1b425540b0fa625799d21573d14b149 (diff)
downloadstroke-bf4830bc9f51a27aba59bc5708caddb835e84789.zip
stroke-bf4830bc9f51a27aba59bc5708caddb835e84789.tar.bz2
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
-rw-r--r--src/com/isode/stroke/muc/MUCImpl.java8
1 files changed, 6 insertions, 2 deletions
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 {
106 /** 106 /**
107 * Change the affiliation of the given Jabber ID. 107 * Change the affiliation of the given Jabber ID.
108 * It must be called with the real JID, not the room JID. 108 * It must be called with the real JID, not the room JID.
109 * @param jid real jabber ID, not null 109 * @param jid real jabber ID, not null. NOTE: This method does not
110 strip any resource from the JID, as expected by XEP-0045. Callers
111 wanting to be strictly XEP-0045 conformant should pass in a bare JID
110 * @param affiliation new affiliation, not null 112 * @param affiliation new affiliation, not null
111 */ 113 */
112 @Override 114 @Override
@@ -114,7 +116,9 @@ public class MUCImpl extends MUC {
114 final MUCAdminPayload mucPayload = new MUCAdminPayload(); 116 final MUCAdminPayload mucPayload = new MUCAdminPayload();
115 MUCItem item = new MUCItem(); 117 MUCItem item = new MUCItem();
116 item.affiliation = affiliation; 118 item.affiliation = affiliation;
117 item.realJID = jid.toBare(); 119 // According to XEP-0045 the JID should be bare, but this isn't being done here because
120 // to provide support for applications where we do want to set affilations on a per resource basis
121 item.realJID = jid;
118 mucPayload.addItem(item); 122 mucPayload.addItem(item);
119 GenericRequest<MUCAdminPayload> request = new GenericRequest<MUCAdminPayload>( 123 GenericRequest<MUCAdminPayload> request = new GenericRequest<MUCAdminPayload>(
120 IQ.Type.Set, getJID(), mucPayload, iqRouter_); 124 IQ.Type.Set, getJID(), mucPayload, iqRouter_);