mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-04 16:16:33 +02:00
Added solution for draft orphans
This commit is contained in:
@@ -795,6 +795,18 @@ public class EntityOperation {
|
||||
if (foreground && folder.sync_state == null) // Show spinner
|
||||
db.folder().setFolderSyncState(fid, "requested");
|
||||
|
||||
if (force && foreground && EntityFolder.DRAFTS.equals(folder.type)) {
|
||||
EntityAccount account = db.account().getAccount(folder.account);
|
||||
if (account.protocol == EntityAccount.TYPE_IMAP) {
|
||||
List<EntityMessage> orphans = db.message().getDraftOrphans(folder.id);
|
||||
if (orphans != null) {
|
||||
EntityLog.log(context, "Draft orphans=" + orphans.size());
|
||||
for (EntityMessage orphan : orphans)
|
||||
EntityOperation.queue(context, orphan, EntityOperation.ADD);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (foreground && EntityFolder.SENT.equals(folder.type)) {
|
||||
EntityAccount account = db.account().getAccount(folder.account);
|
||||
if (account.protocol == EntityAccount.TYPE_IMAP) {
|
||||
|
||||
Reference in New Issue
Block a user