mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-01 14:46:31 +02:00
Propagate labels
This commit is contained in:
@@ -244,14 +244,28 @@ public class EntityMessage implements Serializable {
|
||||
return "notification." + sender.getAddress().toLowerCase(Locale.ROOT);
|
||||
}
|
||||
|
||||
void setLabel(String label, boolean set) {
|
||||
boolean setLabel(String label, boolean set) {
|
||||
List<String> list = new ArrayList<>();
|
||||
if (labels != null)
|
||||
list.addAll(Arrays.asList(labels));
|
||||
list.remove(label);
|
||||
if (set)
|
||||
list.add(label);
|
||||
labels = list.toArray(new String[0]);
|
||||
|
||||
boolean changed = false;
|
||||
if (set) {
|
||||
if (!list.contains(label)) {
|
||||
changed = true;
|
||||
list.add(label);
|
||||
}
|
||||
} else {
|
||||
if (list.contains(label)) {
|
||||
changed = true;
|
||||
list.remove(label);
|
||||
}
|
||||
}
|
||||
|
||||
if (changed)
|
||||
labels = list.toArray(new String[0]);
|
||||
|
||||
return changed;
|
||||
}
|
||||
|
||||
static File getFile(Context context, Long id) {
|
||||
|
||||
Reference in New Issue
Block a user