Roster deletion of userB by userA should not remove userA from userB's roster
Description
Currently Openfire behaves like this: If User A deletes Contact B on his roster, then User A is also deleted on Contact B's roster.
This is due to this logic in IQRosterHandler.java:
IQRosterHandler.java
roster.deleteRosterItem(item.getJID(),true);// Forward set packet to the subscriberif(localServer.isLocal(recipient)){// Recipient is local so let's handle it heretry{Roster recipientRoster = userManager.getUser(recipient.getNode()).getRoster(); recipientRoster.deleteRosterItem(sender,true);}catch(UserNotFoundException e){// Do nothing}}
The correct way, however is to NOT delete User A on Contact B's roster, but instead send presence stanzas of type "unsubscribe" or "unsubscribed":
Currently Openfire behaves like this: If User A deletes Contact B on his roster, then User A is also deleted on Contact B's roster.
This is due to this logic in IQRosterHandler.java:
IQRosterHandler.java
roster.deleteRosterItem(item.getJID(), true); // Forward set packet to the subscriber if (localServer.isLocal(recipient)) { // Recipient is local so let's handle it here try { Roster recipientRoster = userManager.getUser(recipient.getNode()).getRoster(); recipientRoster.deleteRosterItem(sender, true); } catch (UserNotFoundException e) { // Do nothing } }
The correct way, however is to NOT delete User A on Contact B's roster, but instead send presence stanzas of type "unsubscribe" or "unsubscribed":
See http://xmpp.org/rfcs/rfc6121.html#roster-delete-success