Conditionally reset account last connected time

This commit is contained in:
M66B 2019-01-25 06:51:44 +00:00
parent 607f3373ea
commit 9e143870fb
1 changed files with 5 additions and 3 deletions

View File

@ -837,6 +837,10 @@ public class FragmentAccount extends FragmentBase {
account.synchronize != synchronize || account.synchronize != synchronize ||
!account.poll_interval.equals(Integer.parseInt(interval))); !account.poll_interval.equals(Integer.parseInt(interval)));
Long last_connected = null;
if (account != null && synchronize == account.synchronize)
last_connected = account.last_connected;
// Check IMAP server // Check IMAP server
if (check) { if (check) {
Properties props = MessageHelper.getSessionProperties(auth_type, realm, insecure); Properties props = MessageHelper.getSessionProperties(auth_type, realm, insecure);
@ -895,9 +899,7 @@ public class FragmentAccount extends FragmentBase {
account.created = now; account.created = now;
account.error = null; account.error = null;
account.last_connected = last_connected;
if (synchronize)
account.last_connected = now;
if (account.primary) if (account.primary)
db.account().resetPrimary(); db.account().resetPrimary();