From 3148e52cdc7ee97705bfc52a1c7b5ade111f0db8 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 8 Aug 2018 07:29:21 +0000 Subject: [PATCH] On disabling synchronization mark message seen until now Fixes #26 --- app/src/main/java/eu/faircode/email/FragmentAccount.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentAccount.java b/app/src/main/java/eu/faircode/email/FragmentAccount.java index 273abdccdf..bee52029b4 100644 --- a/app/src/main/java/eu/faircode/email/FragmentAccount.java +++ b/app/src/main/java/eu/faircode/email/FragmentAccount.java @@ -43,6 +43,7 @@ import com.sun.mail.imap.IMAPFolder; import com.sun.mail.imap.IMAPStore; import java.util.ArrayList; +import java.util.Date; import java.util.List; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @@ -236,6 +237,7 @@ public class FragmentAccount extends FragmentEx { String port = args.getString("port"); String user = args.getString("user"); String password = args.getString("password"); + boolean synchronize = args.getBoolean("synchronize"); if (TextUtils.isEmpty(host)) throw new Throwable(getContext().getString(R.string.title_no_host)); @@ -259,9 +261,13 @@ public class FragmentAccount extends FragmentEx { account.port = Integer.parseInt(port); account.user = user; account.password = password; - account.synchronize = args.getBoolean("synchronize"); + account.synchronize = synchronize; account.primary = (account.synchronize && args.getBoolean("primary")); + // On disabling synchronization mark message seen until now + if (!account.synchronize && account.synchronize != synchronize) + account.seen_until = new Date().getTime(); + // Check IMAP server List folders = new ArrayList<>(); if (account.synchronize) {