Check sent orphans on foreground sync

This commit is contained in:
M66B
2022-02-22 09:38:29 +01:00
parent 3a0510276a
commit 88bfdc2d41
2 changed files with 12 additions and 7 deletions

View File

@@ -556,6 +556,18 @@ public class EntityOperation {
if (foreground && folder.sync_state == null) // Show spinner
db.folder().setFolderSyncState(fid, "requested");
if (foreground && EntityFolder.SENT.equals(folder.type)) {
EntityAccount account = db.account().getAccount(folder.account);
if (account.protocol == EntityAccount.TYPE_IMAP) {
List<EntityMessage> orphans = db.message().getSentOrphans(folder.id);
if (orphans != null) {
EntityLog.log(context, "Sent orphans=" + orphans.size());
for (EntityMessage orphan : orphans)
EntityOperation.queue(context, orphan, EntityOperation.EXISTS);
}
}
}
if (folder.account == null) // Outbox
if (!outbox) {
Log.e("outbox");