mirror of https://github.com/M66B/FairEmail.git
Refactoring
This commit is contained in:
parent
6ed8168316
commit
6839eef7f8
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue