1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-29 17:52:06 +01:00

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

View file

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