How To Remove Entry From Roster On "Unsubscribed"?


I have a Java application using Smack 3.1.0 which is communicating with Openfire 3.6.4.

I am having a mutual contact removal issue or no contact removal issue. I need to remove the entry from the contact’s roster when the contact rejects the subscription request but leave the contact on the roster of the user who made the request.

Here are the messages being sent from the clients:

user sends:

<query xmlns="jabber:iq:roster">

    <item jid="contactUser@openfire" name="Contact">

        <group>Pending Approval</group>



from this code:

roster.createEntry(xmppUserName + “@” + XMPPServerName, name, groups);

contact user sends back:

<query xmlns="jabber:iq:roster">

    <item jid="user@openfire/resourceName" subscription="remove"></item>


from this code:

Presence p = new Presence(Presence.Type.unsubscribed);




RosterPacket r = new RosterPacket();


Item ri = new Item(to, null);




This removes the entry from both rosters. If the contact does not send:

<query xmlns="jabber:iq:roster">

    <item jid="user@openfire/resourceName" subscription="remove"></item>


Then the entry remains on both rosters.

As far as I can tell, the XMPP messages seem to conform to RFC3921 so it looks to me like OpenFire SHOULD (MUST) remove the contact when sending:

Any help or insight into this issue is greatly appreciated. I’ve looked through lots of mutual deletion issues and I haven’t found any that had a solution. Thanks!!! shows the problem and suggests creating an openfire plugin also discusses the problem which lead to OF-24 but was then marked as “won’t fix”

Message was edited by: Damien Gabrielson to show related issues

I am facing the same problem.

If I send

<query xmlns="jabber:iq:roster">

    <item jid="user@openfire/resourceName" subscription="remove"></item>


the entry is removed in both rosters (the user’s and the contact’s one). This is incorrect.

The spec says nothing about it. It even explicitly states:

Note: When the user removes the contact from the user’s roster, the end state of the contact’s roster is that the user is still in the contact’s roster with a subscription state of “none”; in order to completely remove the roster item for the user, the contact needs to also send a roster removal request.

Any chance this will be fixed?