From 36eef0f2f44492aff7329d3796fd5f11f3b7b817 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 18 Jun 2022 22:12:49 +0200 Subject: [PATCH] Fixed expanded count when deleting messages --- .../java/eu/faircode/email/FragmentMessages.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 14b9af3fb9..43912fdded 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -6167,6 +6167,19 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. if (viewType == AdapterMessage.ViewType.THREAD) { if (handleThreadActions(messages, null, null)) return; + + List ids = values.get("expanded"); + if (ids != null) + for (long id : ids) { + boolean found = false; + for (TupleMessageEx message : messages) + if (message != null && message.id.equals(id)) { + found = true; + break; + } + if (!found) + ids.remove(id); + } } else { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); boolean autoscroll = prefs.getBoolean("autoscroll", false);