Suppress alert 'Too many simultaneous connections'

This commit is contained in:
M66B 2019-03-31 10:12:11 +02:00
parent 17ef530547
commit f2f94d0119
1 changed files with 9 additions and 7 deletions

View File

@ -518,15 +518,17 @@ public class ServiceSynchronize extends LifecycleService {
public void notification(StoreEvent e) { public void notification(StoreEvent e) {
try { try {
wlAccount.acquire(); wlAccount.acquire();
String message = e.getMessage();
if (e.getMessageType() == StoreEvent.ALERT) { if (e.getMessageType() == StoreEvent.ALERT) {
Log.w(account.name + " alert: " + e.getMessage()); Log.w(account.name + " alert: " + message);
db.account().setAccountError(account.id, e.getMessage()); db.account().setAccountError(account.id, message);
Core.reportError( if (BuildConfig.DEBUG ||
ServiceSynchronize.this, account, null, (message != null && !message.startsWith("Too many simultaneous connections")))
new Core.AlertException(e.getMessage())); Core.reportError(ServiceSynchronize.this, account, null,
new Core.AlertException(message));
state.error(); state.error();
} else } else
Log.i(account.name + " notice: " + e.getMessage()); Log.i(account.name + " notice: " + message);
} finally { } finally {
wlAccount.release(); wlAccount.release();
} }
@ -623,7 +625,7 @@ public class ServiceSynchronize extends LifecycleService {
throw ex; throw ex;
} }
final boolean capIdle = ((IMAPStore) istore).hasCapability("IDLE"); final boolean capIdle = istore.hasCapability("IDLE");
Log.i(account.name + " idle=" + capIdle); Log.i(account.name + " idle=" + capIdle);
db.account().setAccountState(account.id, "connected"); db.account().setAccountState(account.id, "connected");