Only fire RosterListener#entriesUpdated for RosterEntries that changed

Description

The RosterPacketListener adds roster entries to the list of updated entries without checking if the entry actually changed. This causes unnecessary notifications to the RosterListeners although there is no new information available for an entry.

The attached patch fixes this bug by implementeng a new #equalsDeep() method for RosterEntry which determines equality using all members of the RosterEntry class.
The RosterPacketListener now only adds the entry to the updated entries if #equalsDeep() compared with the old entry returns false.

Environment

None

Attachments

2
  • 18 Aug 2011, 02:16 PM
  • 25 Apr 2010, 06:32 PM

is related to

Activity

Show:

Robin Collier August 18, 2011 at 2:14 PM

Apparently there are still issues with changing roster entries.

wroot March 19, 2011 at 11:30 AM

Walter Ebeling March 11, 2011 at 8:18 PM

Patch extended in rev 12087

Holger Bergunde March 9, 2011 at 3:32 PM

when i change the group name in spark with smack 2.3.0b2 the renamed group will disappear.
spark does the following:

RosterGroup rosterGroup = roster.getGroup(groupName);
if (rosterGroup != null) {
removeContactGroup(group);
rosterGroup.setName(newName);
}

the "deepquals" method of the RosterEntry doesn't seem to work properly. when the name is changed deepmethod says that the classes are equals even though they have different names!

Walter Ebeling March 8, 2011 at 5:13 PM

Roll back to a version prior the check in of this change allows a rename of groups

Cannot Reproduce

Details

Assignee

Reporter

Labels

Components

Priority

Created April 25, 2010 at 6:32 PM
Updated April 28, 2015 at 8:34 PM
Resolved April 28, 2015 at 8:34 PM

Flag notifications