From 29990109d7187ab120fcc0b436b7b7315b2aedde Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 13 Apr 2021 20:39:46 +0200 Subject: [PATCH] Auto expand pinned message --- app/src/main/java/eu/faircode/email/FragmentMessages.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 6b5dad71bc..0fbfdcf2a9 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -4888,6 +4888,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. TupleMessageEx single = null; TupleMessageEx see = null; TupleMessageEx flag = null; + TupleMessageEx pin = null; for (TupleMessageEx message : messages) { if (message == null) continue; @@ -4909,6 +4910,9 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. } } + if (pinned && message.id.equals(id)) + pin = message; + if (message.folder == folder && !EntityFolder.OUTBOX.equals(message.folderType)) autoCloseCount++; @@ -4920,7 +4924,9 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. // - sole message if (autoexpand) { TupleMessageEx expand = null; - if (count == 1) + if (pin != null) + expand = pin; + else if (count == 1) expand = single; else if (unseen == 1) expand = see;