From c8e91ea24a7f67234f5d826376408653ec24b7a4 Mon Sep 17 00:00:00 2001 From: M66B Date: Tue, 2 Apr 2024 18:36:55 +0200 Subject: [PATCH] Separate inbox filters --- .../main/java/eu/faircode/email/FragmentMessages.java | 9 ++++++++- 1 file changed, 8 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 6919048543..c4ac78d6ee 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -8247,7 +8247,14 @@ public class FragmentMessages extends FragmentBase static String getFilter(Context context, String name, AdapterMessage.ViewType viewType, String type) { String filter; - if (EntityFolder.isOutgoing(type)) + if (EntityFolder.INBOX.equals(type) && context != null) { + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); + String key = "filter_" + type.toLowerCase(Locale.ROOT) + "_" + name; + if (prefs.contains(key)) + filter = type.toLowerCase(Locale.ROOT) + "_"; + else + filter = ""; + } else if (EntityFolder.isOutgoing(type)) filter = "out_"; else if (EntityFolder.ARCHIVE.equals(type) || EntityFolder.TRASH.equals(type) ||