mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-29 11:15:51 +00:00
Keep attachments of unread/flagged messages
This commit is contained in:
parent
f0bcd619d3
commit
1b0af321f7
2 changed files with 5 additions and 7 deletions
|
@ -105,11 +105,10 @@ public interface DaoAttachment {
|
|||
" 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" +
|
||||
" OR (:extra AND" +
|
||||
" (folder.type = '" + EntityFolder.TRASH + "'" +
|
||||
" OR folder.type = '" + EntityFolder.JUNK + "'))))")
|
||||
int purge(long now, boolean extra);
|
||||
" AND message.ui_seen" +
|
||||
" AND NOT message.ui_flagged" +
|
||||
" AND message.received < :now - (folder.sync_days + 1) * 24 * 3600 * 1000)")
|
||||
int purge(long now);
|
||||
|
||||
@Insert
|
||||
long insertAttachment(EntityAttachment attachment);
|
||||
|
|
|
@ -107,8 +107,7 @@ public class WorkerCleanup extends Worker {
|
|||
|
||||
// Delete old attachments
|
||||
if (cleanup_attachments) {
|
||||
int purged = db.attachment().purge(
|
||||
new Date().getTime(), BuildConfig.DEBUG);
|
||||
int purged = db.attachment().purge(new Date().getTime());
|
||||
Log.i("Attachments purged=" + purged);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue