Limit capabilities length

This commit is contained in:
M66B 2021-08-08 14:13:31 +02:00
parent e6c3f22ffe
commit 54e60c7b41
1 changed files with 4 additions and 2 deletions

View File

@ -1339,10 +1339,12 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
optimizeAccount(account, "IDLE");
final boolean capNotify = iservice.hasCapability("NOTIFY");
String capabilities = TextUtils.join(" ", iservice.getCapabilities());
if (capabilities.length() > 500)
capabilities = capabilities.substring(0, 500) + "...";
db.account().setAccountState(account.id, "connected");
db.account().setAccountCapabilities(account.id,
TextUtils.join(" ", iservice.getCapabilities()), capIdle, capUtf8);
db.account().setAccountCapabilities(account.id, capabilities, capIdle, capUtf8);
db.account().setAccountError(account.id, null);
db.account().setAccountWarning(account.id, null);