From db1443ad330d2a097f49a55c798fcd6f598326b6 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 23 Dec 2018 08:24:42 +0000 Subject: [PATCH] Allow archiving sent --- .../java/eu/faircode/email/FragmentMessages.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index adbef477ea..c401ea2673 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -637,7 +637,9 @@ public class FragmentMessages extends FragmentEx { for (EntityMessage threaded : messages) { EntityFolder folder = db.folder().getFolder(threaded.folder); if (!result.target.id.equals(threaded.folder) && - !EntityFolder.isOutgoing(folder.type) && + !EntityFolder.DRAFTS.equals(folder.type) && + !EntityFolder.OUTBOX.equals(folder.type) && + (!EntityFolder.SENT.equals(folder.type) || EntityFolder.ARCHIVE.equals(result.target.type)) && !EntityFolder.TRASH.equals(folder.type) && !EntityFolder.JUNK.equals(folder.type)) result.ids.add(threaded.id); @@ -1344,21 +1346,23 @@ public class FragmentMessages extends FragmentEx { List messages = db.message().getMessageByThread( account, thread, threading ? null : id, null); - boolean deletable = false; + boolean trashable = false; boolean archivable = false; for (EntityMessage message : messages) { EntityFolder folder = db.folder().getFolder(message.folder); if (!EntityFolder.DRAFTS.equals(folder.type) && !EntityFolder.OUTBOX.equals(folder.type) && - !EntityFolder.TRASH.equals(folder.type)) - deletable = true; + // allow sent + !EntityFolder.TRASH.equals(folder.type) && + !EntityFolder.JUNK.equals(folder.type)) + trashable = true; if (!EntityFolder.isOutgoing(folder.type) && !EntityFolder.TRASH.equals(folder.type) && !EntityFolder.JUNK.equals(folder.type)) archivable = true; } - return new Boolean[]{deletable, archivable}; + return new Boolean[]{trashable, archivable}; } @Override