How To Remove Entry From Roster On "Unsubscribed"?

Hi,

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>

    </item>

</query>

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>

</query>

from this code:

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

p.setTo(to);

p.setFrom(myUserName);

connection.sendPacket§;

RosterPacket r = new RosterPacket();

r.setType(IQ.Type.SET);

Item ri = new Item(to, null);

ri.setItemType(RosterPacket.ItemType.remove);

r.addRosterItem(ri);

connection.sendPacket®;

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>

</query>

Then the entry remains on both rosters.

As far as I can tell, the XMPP messages seem to conform to RFC3921 http://xmpp.org/rfcs/rfc3921.html#int-sub-alt 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!!!

http://community.igniterealtime.org/message/188027 shows the problem and suggests creating an openfire plugin

http://community.igniterealtime.org/message/192663 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>

</query>

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?