Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
Stei #1
Member since Oct 2016 · 31 posts
Group memberships: Members
Show profile · Link to this post
Subject: Revoking Membership in an MUC room
I have an MUC room, it consists of an owner and members. When the owner attempts to revoke a user's membership:

  1. <iq id="MX_18" to="AAA-14@muc.domain.net" type="set" xmlns="jabber:client">
  2.  <query xmlns="http://jabber.org/protocol/muc#admin">
  3.     <item affiliation="none" nick="BBB" />
  4.  </query>
  5. </iq>

I receive this response:

  1. <iq to="AAA@domain.net/MatriX-for-Android" id="MX_18" xmlns="jabber:client" type="error" from="AAA-14@muc.domain.net">
  2.  <query xmlns="http://jabber.org/protocol/muc#admin">
  3.     <item affiliation="none" nick="BBB" />
  4.  </query>
  5.  <error code="400" type="modify">
  6.     <bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
  7.  </error>
  8. </iq>

Also, if it matters, the room configuration is set to members only
Avatar
Alex #2
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Is the owner participant of the room while he sends the query?
Avatar
Stei #3
Member since Oct 2016 · 31 posts
Group memberships: Members
Show profile · Link to this post
I'm not sure; I simply create the room and then invite other users, and grant them membership. I don't grant admin priveleges/membership or anything like that to the owner, do I need to do that?

Edit: after granting the owner Admin rights, I still can't remove group members

Edit2: To be more clear, the owner is currently in the room while attempting to revoke membership
This post was edited 2 times, last on 2016-12-13, 04:54 by Stei.
Avatar
Alex #4
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
membership should be granted and revoked by Jid, not by nick. I think this is the problem. YOu try to revoke by nick.
See also:
http://www.xmpp.org/extensions/xep-0045.html#revokemember

Working with the Memberlist as described here may be easier:
http://www.xmpp.org/extensions/xep-0045.html#modifymember

Alex
Avatar
Stei #5
Member since Oct 2016 · 31 posts
Group memberships: Members
Show profile · Link to this post
You're right, the problem was I used nicknames instead of jids. But after calling the RevokeMembership function (also tried the ModifyListAsync function), I again query for a list of the members (RequestMemberListAsync), and the user that should have had their affiliation changed to "none" still has affiliation of "member"
Avatar
Alex #6
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
what is the server response to the revoke iq?
Avatar
Stei #7
Member since Oct 2016 · 31 posts
Group memberships: Members
Show profile · Link to this post
Actually the responses from ModifyListAsync and RevokeMembership are different.

ModifyListAsync response:

  1. <presence to="AAA@domain.net/MatriX-for-Android" xmlns="jabber:client" type="unavailable" from="AAA-1234@muc.domain.net/BBB@domain.net">
  2.  <x xmlns="http://jabber.org/protocol/muc#user">
  3.     <item role="none" affiliation="none" nick="BBB@domain.net">
  4.       <reason>Bye</reason>
  5.     </item>
  6.     <status code="307" />
  7.  </x>
  8. </presence>

^ I also tried just using the nick itself (so the presence was from "AAA-1234@muc.domain.net/BBB" instead, and the item's nick="BBB" instead. But it just resulted inthe same status code (307).

RevokeMembershipAsync response:

  1. <iq to="AAA@domain.net/MatriX-for-Android" id="MX_12" xmlns="jabber:client" type="error" from="AAA-1234@muc.domain.net">
  2.  <query xmlns="http://jabber.org/protocol/muc#admin">
  3.     <item affiliation="none" nick="BBB@domain.net">
  4.       <reason>Kicked</reason>
  5.     </item>
  6.  </query>
  7.  <error code="400" type="modify">
  8.     <bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
  9.  </error>
  10. </iq>
Avatar
Alex #8
Member since Feb 2003 · 4322 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
You are putting the Jid in the nick field on your 2nd request. There is a jid property for it. Also the user part is caps, jids are always normalized (lower case)
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: MatriX RSS