Restore delay send alarms

This commit is contained in:
M66B
2020-04-02 21:13:27 +02:00
parent c93ac65b0c
commit 9fa208930f
4 changed files with 18 additions and 5 deletions

View File

@@ -284,7 +284,7 @@ public class ServiceSend extends ServiceBase {
switch (op.name) {
case EntityOperation.SYNC:
db.folder().setFolderError(outbox.id, null);
onSync(outbox);
break;
case EntityOperation.SEND:
@@ -344,6 +344,16 @@ public class ServiceSend extends ServiceBase {
}
}
private void onSync(EntityFolder outbox) {
DB db = DB.getInstance(this);
db.folder().setFolderError(outbox.id, null);
// Restore snooze timers
for (EntityMessage message : db.message().getSnoozed(outbox.id))
EntityMessage.snooze(this, message.id, message.ui_snoozed);
}
private void onSend(EntityMessage message) throws MessagingException, IOException {
DB db = DB.getInstance(this);
@@ -545,6 +555,7 @@ public class ServiceSend extends ServiceBase {
public void run() {
try {
DB db = DB.getInstance(context);
EntityFolder outbox = db.folder().getOutbox();
if (outbox != null) {
int operations = db.operation().getOperations(outbox.id).size();