Project

General

Profile

Problem with kicking occupant

Added by Vlad Buryj 5 months ago

I trying to kick occupant. For that i use

<iq from='from'
    id='kick1'
    to='roomJID'
    type='set'>
  <query xmlns='http://jabber.org/protocol/muc#admin'>
    <item nick='pistol' role='none'>
      <reason>Avaunt, you cullion!</reason>
    </item>
  </query>
</iq>

also I was trying use that

<iq type=‘set’ to=‘rootJID’ id=‘ban1’>
  <query xmlns=‘http://jabber.org/protocol/muc#admin’/>
    <item affiliation=‘outcast’ jid=‘Jeff@example.com’/> 
  </query>
</iq>

Tigase show

<iq type="error" id="32b9602c-2718-414f-90d0-af5716a9df64" from="" xmlns="jabber:client" to="">
<query xmlns="http://jabber.org/protocol/muc#admin"/>
<item affiliation="outcast" jid=""/>
<error type="modify" code="406"><not-acceptable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></iq>, SIZE=415, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=AUTH, TYPE=error

or

<iq type="error" id="32b9602c-2718-414f-90d0-af5716a9df64" from="" xmlns="jabber:client" to="">
<query xmlns="http://jabber.org/protocol/muc#admin"/>
<item affiliation="outcast" jid=""/>
<error type="modify" code="406"><not-acceptable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error></iq>, SIZE=415, XMLNS=jabber:client, PRIORITY=NORMAL, PERMISSION=NONE, TYPE=error

Anyone know where is problem?

Best regards Vlad


Replies (4)

RE: Problem with kicking occupant - Added by Wojciech Kapcia 5 months ago

Vlad Buryj wrote:

Anyone know where is problem?

It's hard to tell with hidden details but a couple of things to consider:
  • do you have correct affiliation with the room?
  • do you use correct addresses?
  • do you include FullJID in from?

Which Version of the Server and Component do you use?

RE: Problem with kicking occupant - Added by Vlad Buryj 5 months ago

1. yes I have affiliation owner
2. yes I use correct addresses
3. for from I use fullJid

<iq from='FullJid'
id='kick1'
to='BareJid'
type='set'>
<query xmlns='http://jabber.org/protocol/muc#admin'>
<item nick='pistol' role='none'>
<reason>Avaunt, you cullion!</reason>
</item>
</query>
</iq>

RE: Problem with kicking occupant - Added by Vlad Buryj 5 months ago

Vlad Buryj wrote:

1. yes I have affiliation owner
2. yes I use correct addresses
3. for from I use fullJid

[[> <iq from='FullJid'

id='kick1'
to='BareJid'
type='set'>
<query xmlns='http://jabber.org/protocol/muc#admin'>
<item nick='pistol' role='none'>
<reason>Avaunt, you cullion!</reason>
</item>
</query>
</iq>]]

RE: Problem with kicking occupant - Added by Wojciech Kapcia 5 months ago

I just check the workflow and it works for me! Admin user sends kick IQ:

<iq type="set" to="kick_test@muc.tigase.org" id="afa9a">
  <query xmlns="http://jabber.org/protocol/muc#admin">
    <item nick="wojtek" role="none">
      <reason>spam</reason>
    </item>
  </query>
</iq>
and receives IQ response and presences about user leaving:
<iq from="kick_test@muc.tigase.org" type="result" id="afa9a" to="wojtek@tigase.org/resource"/>

<presence from="kick_test@muc.tigase.org/wojtek" type="unavailable" to="wojtek@tigase.org/resource">
    <x xmlns="http://jabber.org/protocol/muc#user">
        <item affiliation="none" nick="wojtek" role="none">
            <reason>spam</reason>
        </item>
        <status code="307"/>
    </x>
</presence>

<presence from="kick_test@muc.tigase.org/wojtek" type="unavailable" to="wojtek@tigase.org/resource">
    <x xmlns="http://jabber.org/protocol/muc#user">
        <item affiliation="none" nick="wojtek" role="none" jid="wojciech.kapcia@tigase.org/resource"/>
    </x>
</presence>

And user got correctly removed from the room.

With the limited information that you provide it's hard to troubleshoot your issue! Verify diligently:
  • affiliations of the users;
  • permissions;
In addition:
  • have you made any changes to Tigase Server/MUC code?
  • have you changed room configuration?
  • you could enable debug for muc component --debug=muc and investigate logs.
    (1-4/4)