From c3eb1c312775a67e64e27375c7ecf3a8b996f10e Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 17 Oct 2018 10:11:24 +0000 Subject: [PATCH] Make sure pending operations will be executed --- .../java/eu/faircode/email/ServiceSynchronize.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index 77a67552..86b1a778 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -992,6 +992,15 @@ public class ServiceSynchronize extends LifecycleService { LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(ServiceSynchronize.this); lbm.registerReceiver(processFolder, f); + for (EntityFolder folder : folders.keySet()) + if (db.operation().getOperationCount(folder.id) > 0) { + Intent intent = new Intent(); + intent.setType("account/" + account.id); + intent.setAction(ServiceSynchronize.ACTION_PROCESS_OPERATIONS); + intent.putExtra("folder", folder.id); + lbm.sendBroadcast(intent); + } + // Keep alive alarm receiver BroadcastReceiver alarm = new BroadcastReceiver() { @Override @@ -1985,6 +1994,7 @@ public class ServiceSynchronize extends LifecycleService { f.addDataType("account/outbox"); LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(ServiceSynchronize.this); lbm.registerReceiver(outboxReceiver, f); + db.folder().setFolderState(outbox.id, "connected"); db.folder().setFolderError(outbox.id, null);