Retry adding drafts without attachments

pull/194/merge
M66B 3 years ago
parent 82c42122c0
commit a60dde6926

@ -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) &&

@ -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);

Loading…
Cancel
Save