Messages in the same folder are not duplicate

Since messages should have unique messages IDs this should not happen
This commit is contained in:
M66B 2020-03-25 08:29:52 +01:00
parent e8d3dbf96e
commit 83820ef382
1 changed files with 10 additions and 5 deletions

View File

@ -3908,13 +3908,18 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
Collections.sort(dups, new Comparator<TupleMessageEx>() {
@Override
public int compare(TupleMessageEx d1, TupleMessageEx d2) {
int o1 = DUPLICATE_ORDER.indexOf(d1.folderType);
int o2 = DUPLICATE_ORDER.indexOf(d2.folderType);
return ((Integer) o1).compareTo(o2);
Integer o1 = DUPLICATE_ORDER.indexOf(d1.folderType);
Integer o2 = DUPLICATE_ORDER.indexOf(d2.folderType);
return o1.compareTo(o2);
}
});
for (int i = 1; i < dups.size(); i++)
dups.get(i).duplicate = true;
TupleMessageEx first = dups.get(0);
for (int i = 1; i < dups.size(); i++) {
TupleMessageEx dup = dups.get(i);
if (!Objects.equals(first.folderType, dup.folderType))
dup.duplicate = true;
}
}
}