Simplification

pull/199/head
M66B 4 years ago
parent b4597c216a
commit 0106da9b07

@ -481,22 +481,22 @@ public class EntityOperation {
if (message != null) { if (message != null) {
db.message().setMessageUiHide(message, false); db.message().setMessageUiHide(message, false);
if (EntityOperation.SEEN.equals(name)) { if (SEEN.equals(name)) {
EntityMessage m = db.message().getMessage(message); EntityMessage m = db.message().getMessage(message);
if (m != null) if (m != null)
db.message().setMessageUiSeen(m.id, m.seen); db.message().setMessageUiSeen(m.id, m.seen);
} }
if (EntityOperation.FLAG.equals(name)) { if (FLAG.equals(name)) {
EntityMessage m = db.message().getMessage(message); EntityMessage m = db.message().getMessage(message);
if (m != null) if (m != null)
db.message().setMessageUiFlagged(m.id, m.flagged, m.color); db.message().setMessageUiFlagged(m.id, m.flagged, m.color);
} }
} }
if (EntityOperation.MOVE.equals(name) || if (MOVE.equals(name) ||
EntityOperation.ADD.equals(name) || ADD.equals(name) ||
EntityOperation.RAW.equals(name)) RAW.equals(name))
try { try {
JSONArray jargs = new JSONArray(args); JSONArray jargs = new JSONArray(args);
long tmpid = jargs.optLong(2, -1); long tmpid = jargs.optLong(2, -1);
@ -508,13 +508,13 @@ public class EntityOperation {
Log.e(ex); Log.e(ex);
} }
if (EntityOperation.EXISTS.equals(name)) { if (EXISTS.equals(name)) {
EntityMessage m = db.message().getMessage(message); EntityMessage m = db.message().getMessage(message);
if (m != null) if (m != null)
queue(context, m, EntityOperation.ADD); queue(context, m, ADD);
} }
if (EntityOperation.ATTACHMENT.equals(name)) if (ATTACHMENT.equals(name))
try { try {
JSONArray jargs = new JSONArray(args); JSONArray jargs = new JSONArray(args);
long id = jargs.getLong(0); long id = jargs.getLong(0);
@ -525,7 +525,7 @@ public class EntityOperation {
Log.e(ex); Log.e(ex);
} }
if (EntityOperation.SYNC.equals(name)) if (SYNC.equals(name))
db.folder().setFolderSyncState(folder, null); db.folder().setFolderSyncState(folder, null);
if (fetch && message != null) { if (fetch && message != null) {
@ -537,8 +537,8 @@ public class EntityOperation {
if (f == null) if (f == null)
return; return;
if (EntityOperation.FETCH.equals(name)) if (FETCH.equals(name))
EntityOperation.sync(context, f.id, false); sync(context, f.id, false);
else else
queue(context, f, FETCH, m.uid); queue(context, f, FETCH, m.uid);
} }

Loading…
Cancel
Save