From f6ee97ebbf2ab5b62c8e7ec3a79fec133e88e06e Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 21 Dec 2018 19:17:45 +0100 Subject: [PATCH] Skip archiving sent/trash/junk --- .../main/java/eu/faircode/email/FragmentMessages.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 416bdf613a..c2d3346318 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -587,6 +587,7 @@ public class FragmentMessages extends FragmentEx { Bundle args = new Bundle(); args.putLong("account", account); args.putString("thread", thread); + args.putLong("id", id); args.putString("folderType", folderType); new SimpleTask() { @@ -594,6 +595,7 @@ public class FragmentMessages extends FragmentEx { protected MessageTarget onLoad(Context context, Bundle args) { long account = args.getLong("account"); String thread = args.getString("thread"); + long id = args.getLong("id"); String folderType = args.getString("folderType"); MessageTarget result = new MessageTarget(); @@ -606,9 +608,14 @@ public class FragmentMessages extends FragmentEx { List messages = db.message().getMessageByThread( account, thread, threading ? null : id, null); - for (EntityMessage threaded : messages) - if (!result.target.id.equals(threaded.folder)) + for (EntityMessage threaded : messages) { + EntityFolder folder = db.folder().getFolder(threaded.folder); + if (!result.target.id.equals(threaded.folder) && + !EntityFolder.SENT.equals(folder.type) && + !EntityFolder.TRASH.equals(folder.type) && + !EntityFolder.JUNK.equals(folder.type)) result.ids.add(threaded.id); + } db.setTransactionSuccessful(); } finally {