From fb8646f3714eec9cbb27ad370b0c7d5d4382f811 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 25 Jan 2019 18:57:08 +0000 Subject: [PATCH] Conditionally reset last connected on saving identity --- app/src/main/java/eu/faircode/email/FragmentIdentity.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/FragmentIdentity.java b/app/src/main/java/eu/faircode/email/FragmentIdentity.java index 54df401970..d0b58a7884 100644 --- a/app/src/main/java/eu/faircode/email/FragmentIdentity.java +++ b/app/src/main/java/eu/faircode/email/FragmentIdentity.java @@ -577,6 +577,10 @@ public class FragmentIdentity extends FragmentBase { realm == null ? identityRealm != null : !realm.equals(identityRealm))); boolean reload = (identity == null || identity.synchronize != synchronize || check); + Long last_connected = null; + if (identity != null && synchronize == identity.synchronize) + last_connected = identity.last_connected; + // Check SMTP server if (check) { String transportType = (starttls ? "smtp" : "smtps"); @@ -630,6 +634,7 @@ public class FragmentIdentity extends FragmentBase { identity.store_sent = store_sent; identity.sent_folder = null; identity.error = null; + identity.last_connected = last_connected; if (identity.primary) db.identity().resetPrimary(account);