Persist account capabilities

This commit is contained in:
M66B
2021-06-04 15:54:29 +02:00
parent 27942e1e0d
commit 3c1f44f1b1
6 changed files with 2495 additions and 2 deletions

View File

@@ -1282,6 +1282,9 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
// https://tools.ietf.org/html/rfc2177
final boolean capIdle = iservice.hasCapability("IDLE");
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");
@@ -1289,6 +1292,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
final boolean capNotify = iservice.hasCapability("NOTIFY");
db.account().setAccountState(account.id, "connected");
db.account().setAccountCapabilities(account.id, capIdle, capUtf8);
db.account().setAccountError(account.id, null);
db.account().setAccountWarning(account.id, null);