1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-02 13:14:39 +00:00

Retry adding drafts without attachments

This commit is contained in:
M66B 2022-01-22 20:07:40 +01:00
parent 82c42122c0
commit a60dde6926
2 changed files with 7 additions and 1 deletions

View file

@ -584,7 +584,9 @@ class Core {
EntityOperation.HEADERS.equals(op.name) ||
EntityOperation.RAW.equals(op.name) ||
EntityOperation.ATTACHMENT.equals(op.name) ||
(EntityOperation.ADD.equals(op.name) &&
((op.tries >= LOCAL_RETRY_MAX ||
db.attachment().countAttachments(op.message) > 0) &&
EntityOperation.ADD.equals(op.name) &&
EntityFolder.DRAFTS.equals(folder.type)) ||
(op.tries >= LOCAL_RETRY_MAX &&
EntityOperation.SYNC.equals(op.name) &&

View file

@ -43,6 +43,10 @@ public interface DaoAttachment {
" ORDER BY sequence, subsequence")
List<EntityAttachment> getAttachments(long message);
@Query("SELECT COUNT(*) FROM attachment" +
" WHERE message = :message")
int countAttachments(long message);
@Query("SELECT * FROM attachment" +
" WHERE id = :id")
EntityAttachment getAttachment(long id);