From 7635493db2cd9a747c99c706f0efac6363fd29b9 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 17 Aug 2021 20:29:40 +0200 Subject: [PATCH] Gmail account specials --- .../eu/faircode/email/EntityOperation.java | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/EntityOperation.java b/app/src/main/java/eu/faircode/email/EntityOperation.java index cbecf538b3..6ba5cafee9 100644 --- a/app/src/main/java/eu/faircode/email/EntityOperation.java +++ b/app/src/main/java/eu/faircode/email/EntityOperation.java @@ -226,17 +226,19 @@ public class EntityOperation { db.message().setMessageImportance(similar.id, null); } - EntityAccount account = db.account().getAccount(message.account); - if ((account != null && !account.isGmail()) || - !EntityFolder.ARCHIVE.equals(source.type) || - EntityFolder.TRASH.equals(target.type) || EntityFolder.JUNK.equals(target.type)) - if (!message.ui_deleted) - db.message().setMessageUiHide(message.id, true); - - if (account != null && account.isGmail() && - EntityFolder.ARCHIVE.equals(source.type) && - !(EntityFolder.TRASH.equals(target.type) || EntityFolder.JUNK.equals(target.type))) - name = COPY; + if (source.account.equals(target.account)) { + EntityAccount account = db.account().getAccount(message.account); + if ((account != null && !account.isGmail()) || + !EntityFolder.ARCHIVE.equals(source.type) || + EntityFolder.TRASH.equals(target.type) || EntityFolder.JUNK.equals(target.type)) + if (!message.ui_deleted) + db.message().setMessageUiHide(message.id, true); + + if (account != null && account.isGmail() && + EntityFolder.ARCHIVE.equals(source.type) && + !(EntityFolder.TRASH.equals(target.type) || EntityFolder.JUNK.equals(target.type))) + name = COPY; + } if (message.ui_snoozed != null && (EntityFolder.ARCHIVE.equals(target.type) || EntityFolder.TRASH.equals(target.type))) {