From 9ce5984f6fe460f7f35df7840f161119fe43905b Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 25 Feb 2021 10:19:15 +0100 Subject: [PATCH] Apply sync/force on first start --- .../main/java/eu/faircode/email/ServiceSynchronize.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index 751c0dc351..7b40ab85b4 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -252,6 +252,9 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences if (account > 0 && !current.accountState.id.equals(account)) continue; + boolean sync = current.command.getBoolean("sync", false); + boolean force = current.command.getBoolean("force", false); + int index = accountStates.indexOf(current); if (index < 0) { if (current.canRun()) { @@ -266,12 +269,10 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences " state=" + current.accountState.state + " active=" + current.networkState.getActive()); event = true; - start(current, current.accountState.isEnabled(current.enabled), false); + start(current, current.accountState.isEnabled(current.enabled) || sync, force); } } else { boolean reload = false; - boolean sync = current.command.getBoolean("sync", false); - boolean force = current.command.getBoolean("force", false); switch (current.command.getString("name")) { case "reload": reload = true;