Auto delete browsed messages

pull/194/merge
M66B 3 years ago
parent 811c543fa2
commit 7379c4f90e

@ -3168,7 +3168,7 @@ class Core {
// Delete old local messages
if (auto_delete) {
List<Long> tbds = db.message().getMessagesBefore(folder.id, keep_time, delete_unseen);
List<Long> tbds = db.message().getMessagesBefore(folder.id, sync_time, keep_time, delete_unseen);
Log.i(folder.name + " local tbd=" + tbds.size());
EntityFolder trash = db.folder().getFolderByType(folder.account, EntityFolder.TRASH);
for (Long tbd : tbds) {

@ -928,13 +928,13 @@ public interface DaoMessage {
@Query("SELECT id FROM message" +
" WHERE folder = :folder" +
" AND received < :before" +
" AND received < :keep_time" +
" AND NOT uid IS NULL" +
" AND (ui_seen OR :unseen)" +
" AND NOT ui_flagged" +
" AND NOT ui_browsed" +
" AND stored < :sync_time" + // moved, browsed
" AND ui_snoozed IS NULL")
List<Long> getMessagesBefore(long folder, long before, boolean unseen);
List<Long> getMessagesBefore(long folder, long sync_time, long keep_time, boolean unseen);
@Query("DELETE FROM message" +
" WHERE folder = :folder" +

Loading…
Cancel
Save