From c3c3baae1786aeb0b2d7af7af236ef5afbac85d0 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 20 Nov 2020 08:31:08 +0100 Subject: [PATCH] Consistent double tap to mark read --- .../eu/faircode/email/AdapterMessage.java | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index b40a129336..f10681930d 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -3036,19 +3036,19 @@ public class AdapterMessage extends RecyclerView.Adapter() { @Override protected Void onExecute(Context context, Bundle args) { long id = args.getLong("id"); - int protocol = args.getInt("protocol"); + boolean seen = args.getBoolean("seen"); DB db = DB.getInstance(context); try { @@ -3058,15 +3058,12 @@ public class AdapterMessage extends RecyclerView.Adapter messages = db.message().getMessagesByThread( - message.account, message.thread, threading ? null : id, message.ui_seen ? message.folder : null); - for (EntityMessage threaded : messages) - if (threaded.ui_seen == message.ui_seen) - EntityOperation.queue(context, threaded, EntityOperation.SEEN, !message.ui_seen); - } + // When marking read: in all folders + List messages = db.message().getMessagesByThread( + message.account, message.thread, threading ? null : id, seen ? null : message.folder); + for (EntityMessage threaded : messages) + if (threaded.ui_seen != seen) + EntityOperation.queue(context, threaded, EntityOperation.SEEN, seen); db.setTransactionSuccessful(); } finally {