mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-03 03:19:24 +01:00
Added setting to delete old attachments
This commit is contained in:
@@ -97,6 +97,17 @@ public interface DaoAttachment {
|
||||
" WHERE id = :id")
|
||||
void setCid(long id, String cid);
|
||||
|
||||
@Query("UPDATE attachment" +
|
||||
" SET available = 0" +
|
||||
" WHERE EXISTS" +
|
||||
" (SELECT * FROM attachment a" +
|
||||
" JOIN message ON message.id = a.message" +
|
||||
" JOIN folder ON folder.id = message.folder" +
|
||||
" WHERE a.id = attachment.id" +
|
||||
" AND a.available" +
|
||||
" AND message.stored < :now - folder.sync_days * 24 * 3600 * 1000)")
|
||||
int purge(long now);
|
||||
|
||||
@Insert
|
||||
long insertAttachment(EntityAttachment attachment);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user