From 4fbb29df2e4ffba511293e05d4293e8f5b3ef8eb Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 22 Apr 2020 08:47:39 +0200 Subject: [PATCH] Optionally search on sent time --- app/src/main/java/eu/faircode/email/Core.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index ecef22bb2d..6b620c8fd3 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -1809,9 +1809,10 @@ class Core { // Reduce list of local uids Flags flags = ifolder.getPermanentFlags(); SearchTerm searchTerm = new ReceivedDateTerm(ComparisonTerm.GE, new Date(sync_time)); - searchTerm = new OrTerm(searchTerm, new SentDateTerm(ComparisonTerm.GE, new Date(sync_time))); - if (sync_nodate) + if (sync_nodate) { + searchTerm = new OrTerm(searchTerm, new SentDateTerm(ComparisonTerm.GE, new Date(sync_time))); searchTerm = new OrTerm(searchTerm, new ReceivedDateTerm(ComparisonTerm.LT, new Date(365 * 24 * 3600 * 1000L))); + } if (sync_unseen && flags.contains(Flags.Flag.SEEN)) searchTerm = new OrTerm(searchTerm, new FlagTerm(new Flags(Flags.Flag.SEEN), false)); if (sync_flagged && flags.contains(Flags.Flag.FLAGGED))