Keep attachments of unread/flagged messages

pull/178/head
M66B 5 years ago
parent f0bcd619d3
commit 1b0af321f7

@ -105,11 +105,10 @@ public interface DaoAttachment {
" JOIN folder ON folder.id = message.folder" + " JOIN folder ON folder.id = message.folder" +
" WHERE a.id = attachment.id" + " WHERE a.id = attachment.id" +
" AND a.available" + " AND a.available" +
" AND (message.stored < :now - folder.sync_days * 24 * 3600 * 1000" + " AND message.ui_seen" +
" OR (:extra AND" + " AND NOT message.ui_flagged" +
" (folder.type = '" + EntityFolder.TRASH + "'" + " AND message.received < :now - (folder.sync_days + 1) * 24 * 3600 * 1000)")
" OR folder.type = '" + EntityFolder.JUNK + "'))))") int purge(long now);
int purge(long now, boolean extra);
@Insert @Insert
long insertAttachment(EntityAttachment attachment); long insertAttachment(EntityAttachment attachment);

@ -107,8 +107,7 @@ public class WorkerCleanup extends Worker {
// Delete old attachments // Delete old attachments
if (cleanup_attachments) { if (cleanup_attachments) {
int purged = db.attachment().purge( int purged = db.attachment().purge(new Date().getTime());
new Date().getTime(), BuildConfig.DEBUG);
Log.i("Attachments purged=" + purged); Log.i("Attachments purged=" + purged);
} }

Loading…
Cancel
Save