1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-31 20:25:38 +00:00

Cleanup attachments for IMAP only

This commit is contained in:
M66B 2021-10-21 10:38:42 +02:00
parent b4f50d36d6
commit 562e5acede

View file

@ -120,15 +120,17 @@ public interface DaoAttachment {
" SET available = 0" +
" WHERE NOT (available IS 0)" +
" AND EXISTS" +
" (SELECT * FROM attachment a" +
" (SELECT * FROM attachment AS a" +
" JOIN message ON message.id = a.message" +
" JOIN folder ON folder.id = message.folder" +
" JOIN account ON account.id = message.account" +
" WHERE a.id = attachment.id" +
" AND a.available" +
" AND message.ui_seen" +
" AND NOT message.ui_flagged" +
" AND encryption IS NULL" +
" AND message.received < :now - (folder.sync_days + 1) * 24 * 3600 * 1000)")
" AND message.received < :now - (folder.sync_days + 1) * 24 * 3600 * 1000" +
" AND account.pop = " + EntityAccount.TYPE_IMAP + ")")
int purge(long now);
@Insert