From 497b47d9d0fdf1cefd19060e95fe76c9e668d4a4 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 30 May 2024 09:05:41 +0200 Subject: [PATCH] Fixed interaction sync/delete unseen --- app/src/main/java/eu/faircode/email/Core.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index 1cb00388f6..79ab88becf 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -3876,7 +3876,7 @@ class Core { keep_time = 0; long keep_unread_time = cal_keep_unread.getTimeInMillis(); - if (keep_unread_time < 0) + if (keep_unread_time < 0 || sync_unseen) keep_unread_time = 0; Log.i(folder.name + " sync=" + new Date(sync_time) + @@ -3886,7 +3886,7 @@ class Core { // Delete old local messages long delete_time = new Date().getTime() - 3600 * 1000L; if (auto_delete) { - List tbds = db.message().getMessagesBefore(folder.id, delete_time, keep_time, keep_unread_time, delete_unseen); + List tbds = db.message().getMessagesBefore(folder.id, delete_time, keep_time, keep_unread_time, delete_unseen && !sync_unseen); Log.i(folder.name + " local tbd=" + tbds.size()); EntityFolder trash = db.folder().getFolderByType(folder.account, EntityFolder.TRASH); for (Long tbd : tbds) { @@ -3899,7 +3899,7 @@ class Core { EntityOperation.queue(context, message, EntityOperation.MOVE, trash.id); } } else { - int old = db.message().deleteMessagesBefore(folder.id, delete_time, keep_time, keep_unread_time, delete_unseen); + int old = db.message().deleteMessagesBefore(folder.id, delete_time, keep_time, keep_unread_time, delete_unseen && !sync_unseen); Log.i(folder.name + " local old=" + old); }