Browse Source

Fixes

main
M66B 6 years ago
parent
commit
9e60b4eabd
2 changed files with 9 additions and 15 deletions
  1. +0
    -3
      app/src/main/java/eu/faircode/email/EntityOperation.java
  2. +9
    -12
      app/src/main/java/eu/faircode/email/ServiceSynchronize.java

+ 0
- 3
app/src/main/java/eu/faircode/email/EntityOperation.java View File

@ -86,9 +86,6 @@ public class EntityOperation {
return; return;
} }
purged = dao.deleteOperations(message.id, name); purged = dao.deleteOperations(message.id, name);
} else if (DELETE.equals(name)) {
if (message.uid == null)
return;
} }
EntityOperation operation = new EntityOperation(); EntityOperation operation = new EntityOperation();


+ 9
- 12
app/src/main/java/eu/faircode/email/ServiceSynchronize.java View File

@ -473,13 +473,6 @@ public class ServiceSynchronize extends LifecycleService {
} catch (Throwable ex) { } catch (Throwable ex) {
Log.e(Helper.TAG, folder.name + " " + ex + "\n" + Log.getStackTraceString(ex)); Log.e(Helper.TAG, folder.name + " " + ex + "\n" + Log.getStackTraceString(ex));
reportError(account.name, folder.name, ex); reportError(account.name, folder.name, ex);
// Cascade up
try {
fstore.close();
} catch (MessagingException e1) {
Log.w(Helper.TAG, folder.name + " " + e1 + "\n" + Log.getStackTraceString(e1));
}
} finally { } finally {
if (shouldClose) if (shouldClose)
if (ifolder != null && ifolder.isOpen()) { if (ifolder != null && ifolder.isOpen()) {
@ -738,11 +731,13 @@ public class ServiceSynchronize extends LifecycleService {
} else if (EntityOperation.DELETE.equals(op.name)) { } else if (EntityOperation.DELETE.equals(op.name)) {
// Delete message // Delete message
Message imessage = ifolder.getMessageByUID(op.uid);
if (imessage == null)
throw new MessageRemovedException();
imessage.setFlag(Flags.Flag.DELETED, true);
ifolder.expunge();
if (op.uid != null) {
Message imessage = ifolder.getMessageByUID(op.uid);
if (imessage == null)
throw new MessageRemovedException();
imessage.setFlag(Flags.Flag.DELETED, true);
ifolder.expunge();
}
message.deleteMessage(op.message); message.deleteMessage(op.message);
@ -1031,6 +1026,8 @@ public class ServiceSynchronize extends LifecycleService {
long id = MimeMessageEx.getId(imessage); long id = MimeMessageEx.getId(imessage);
message = db.message().getMessage(id); message = db.message().getMessage(id);
if (message.folder != folder.id)
message = null; // Archive
boolean update = (message != null); boolean update = (message != null);
if (message == null) if (message == null)
message = new EntityMessage(); message = new EntityMessage();


Loading…
Cancel
Save