Refactoring

This commit is contained in:
M66B 2019-06-14 10:42:54 +02:00
parent 6ed8168316
commit 6839eef7f8
1 changed files with 7 additions and 9 deletions

View File

@ -155,14 +155,15 @@ class Core {
JSONArray jargs = new JSONArray(op.args); JSONArray jargs = new JSONArray(op.args);
try { try {
if (message == null &&
!EntityOperation.SYNC.equals(op.name) &&
!EntityOperation.SUBSCRIBE.equals(op.name))
throw new MessageRemovedException();
db.operation().setOperationError(op.id, null); db.operation().setOperationError(op.id, null);
if (!EntityOperation.SYNC.equals(op.name))
db.operation().setOperationState(op.id, "executing");
if (message != null) { if (message == null) {
if (!EntityOperation.SYNC.equals(op.name) &&
!EntityOperation.SUBSCRIBE.equals(op.name))
throw new MessageRemovedException();
} else {
db.message().setMessageError(message.id, null); db.message().setMessageError(message.id, null);
if (!EntityOperation.ADD.equals(op.name)) if (!EntityOperation.ADD.equals(op.name))
ensureUid(context, folder, message, (IMAPFolder) ifolder); ensureUid(context, folder, message, (IMAPFolder) ifolder);
@ -170,9 +171,6 @@ class Core {
// Operations should use database transaction when needed // Operations should use database transaction when needed
if (!EntityOperation.SYNC.equals(op.name))
db.operation().setOperationState(op.id, "executing");
switch (op.name) { switch (op.name) {
case EntityOperation.SEEN: case EntityOperation.SEEN:
onSeen(context, jargs, folder, message, (IMAPFolder) ifolder); onSeen(context, jargs, folder, message, (IMAPFolder) ifolder);