From 982eeb70437dcd23d2ecd1432e0c2695058019bb Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 9 Aug 2021 07:28:07 +0200 Subject: [PATCH] Refactoring --- .../main/java/eu/faircode/email/ServiceSynchronize.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index 1d7ecce526..6fbff8fcda 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -1334,15 +1334,16 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences final boolean capUtf8 = iservice.hasCapability("UTF8=ACCEPT") || iservice.hasCapability("UTF8=ONLY"); - Log.i(account.name + " idle=" + capIdle); - if (!capIdle || account.poll_interval < OPTIMIZE_KEEP_ALIVE_INTERVAL) - optimizeAccount(account, "IDLE"); - final boolean capNotify = iservice.hasCapability("NOTIFY"); + String capabilities = TextUtils.join(" ", iservice.getCapabilities()); if (capabilities.length() > 500) capabilities = capabilities.substring(0, 500) + "..."; + Log.i(account.name + " idle=" + capIdle); + if (!capIdle || account.poll_interval < OPTIMIZE_KEEP_ALIVE_INTERVAL) + optimizeAccount(account, "IDLE"); + db.account().setAccountState(account.id, "connected"); db.account().setAccountCapabilities(account.id, capabilities, capIdle, capUtf8); db.account().setAccountError(account.id, null);