mirror of https://github.com/M66B/FairEmail.git
Added retry for sent orphans
This commit is contained in:
parent
9b587e59dd
commit
0223efaf8a
|
@ -805,6 +805,15 @@ public interface DaoMessage {
|
|||
" AND m.msgid = message.msgid)")
|
||||
int deleteOrphans(long folder);
|
||||
|
||||
@Query("SELECT * FROM message" +
|
||||
" WHERE folder = :folder" +
|
||||
" AND uid IS NULL" +
|
||||
" AND NOT EXISTS" +
|
||||
" (SELECT * FROM operation" +
|
||||
" WHERE operation.message = message.id" +
|
||||
" AND operation.name = '" + EntityOperation.EXISTS + "')")
|
||||
List<EntityMessage> getSentOrphans(long folder);
|
||||
|
||||
@Query("SELECT id FROM message" +
|
||||
" WHERE folder = :folder" +
|
||||
" AND received < :before" +
|
||||
|
|
|
@ -1519,6 +1519,13 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|||
force = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (EntityFolder.SENT.equals(folder.type)) {
|
||||
List<EntityMessage> orphans = db.message().getSentOrphans(folder.id);
|
||||
if (orphans != null)
|
||||
for (EntityMessage orphan : orphans)
|
||||
EntityOperation.queue(context, orphan, EntityOperation.EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
db.setTransactionSuccessful();
|
||||
|
|
Loading…
Reference in New Issue