Commit 260ce296 authored by csh's avatar csh

OF-720: Roster deletion of userB by userA should not remove userA from userB's roster

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@13943 b35dd754-fafc-0310-a699-88a17e54d16e
parent e528a180
......@@ -272,8 +272,21 @@ public class IQRosterHandler extends IQHandler implements ServerFeaturesProvider
if (localServer.isLocal(recipient)) { // Recipient is local so let's handle it here
try {
Roster recipientRoster = userManager.getUser(recipient.getNode()).getRoster();
// Instead of deleting the sender in the recipient's roster, update it.
// http://issues.igniterealtime.org/browse/OF-720
RosterItem rosterItem = recipientRoster.getRosterItem(sender);
// If the receiver doesn't have subscribed yet, delete the sender from the receiver's roster, too.
if (rosterItem.getRecvStatus().equals(RosterItem.RECV_SUBSCRIBE)) {
recipientRoster.deleteRosterItem(sender, true);
}
// Otherwise only update it, so that the sender is not deleted from the receivers roster.
else {
rosterItem.setAskStatus(RosterItem.ASK_NONE);
rosterItem.setRecvStatus(RosterItem.RECV_NONE);
rosterItem.setSubStatus(RosterItem.SUB_NONE);
recipientRoster.updateRosterItem(rosterItem);
}
}
catch (UserNotFoundException e) {
// Do nothing
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment