mirror of https://github.com/M66B/FairEmail.git
Execute local seen/flagged on failure
This commit is contained in:
parent
12aac56d81
commit
edb3a1cad8
|
@ -834,14 +834,32 @@ public class EntityOperation {
|
|||
|
||||
if (SEEN.equals(name)) {
|
||||
EntityMessage m = db.message().getMessage(message);
|
||||
if (m != null)
|
||||
db.message().setMessageUiSeen(m.id, m.seen);
|
||||
if (m != null) {
|
||||
boolean seen = m.seen;
|
||||
try {
|
||||
JSONArray jargs = new JSONArray(args);
|
||||
seen = jargs.getBoolean(0);
|
||||
} catch (Throwable ex) {
|
||||
Log.e(ex);
|
||||
}
|
||||
db.message().setMessageUiSeen(m.id, seen);
|
||||
}
|
||||
}
|
||||
|
||||
if (FLAG.equals(name)) {
|
||||
EntityMessage m = db.message().getMessage(message);
|
||||
if (m != null)
|
||||
db.message().setMessageUiFlagged(m.id, m.flagged, m.color);
|
||||
if (m != null) {
|
||||
boolean flagged = m.flagged;
|
||||
Integer color = m.color;
|
||||
try {
|
||||
JSONArray jargs = new JSONArray(args);
|
||||
flagged = jargs.getBoolean(0);
|
||||
color = (jargs.length() > 1 && !jargs.isNull(1) ? jargs.getInt(1) : null);
|
||||
} catch (Throwable ex) {
|
||||
Log.e(ex);
|
||||
}
|
||||
db.message().setMessageUiFlagged(m.id, flagged, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue