Fix unfiledEntries not updating

If an roster push with a roster entry without any group is processed,
then the entry is not updated, because unfiledEntries.contains(entry)
would return true, as the RosterEntry.equals() method only compares the
name.

We simply fix it by always removing the entry first and then adding it
again.

Thanks to Christian Schudt for pointing this out.

SMACK-559
This commit is contained in:
Florian Schmaus 2014-04-29 15:15:59 +02:00
parent 10e82fae45
commit fd532be9b6
1 changed files with 2 additions and 3 deletions

View File

@ -702,9 +702,8 @@ public class Roster {
// Mark the entry as unfiled if it does not belong to any groups.
if (item.getGroupNames().isEmpty()) {
if (!unfiledEntries.contains(entry)) {
unfiledEntries.add(entry);
}
unfiledEntries.remove(entry);
unfiledEntries.add(entry);
}
else {
unfiledEntries.remove(entry);