1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-02 13:14:39 +00:00

Compare stored time against sync time

This commit is contained in:
M66B 2021-05-26 19:39:08 +02:00
parent 3c95d95331
commit abda25a42c
2 changed files with 4 additions and 4 deletions

View file

@ -2617,7 +2617,7 @@ class Core {
EntityOperation.queue(context, message, EntityOperation.MOVE, trash.id);
}
} else {
int old = db.message().deleteMessagesBefore(folder.id, keep_time, delete_unseen);
int old = db.message().deleteMessagesBefore(folder.id, sync_time, keep_time, delete_unseen);
Log.i(folder.name + " local old=" + old);
}

View file

@ -862,11 +862,11 @@ public interface DaoMessage {
@Query("DELETE 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 stored < :before" + // moved, browsed
" AND stored < :sync_time" + // moved, browsed
" AND ui_snoozed IS NULL")
int deleteMessagesBefore(long folder, long before, boolean unseen);
int deleteMessagesBefore(long folder, long sync_time, long keep_time, boolean unseen);
}