From 5074f51060d05beb3558d04a8c8a9c9f44aa01ff Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 28 Apr 2019 18:26:50 +0200 Subject: [PATCH] Skip filtering outbox --- app/src/main/java/eu/faircode/email/DaoMessage.java | 4 ++-- app/src/main/java/eu/faircode/email/FragmentMessages.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/DaoMessage.java b/app/src/main/java/eu/faircode/email/DaoMessage.java index 0bdc7bda6f..92e35e7adc 100644 --- a/app/src/main/java/eu/faircode/email/DaoMessage.java +++ b/app/src/main/java/eu/faircode/email/DaoMessage.java @@ -110,11 +110,11 @@ public interface DaoMessage { " JOIN folder f ON f.id = :folder" + " WHERE (message.account = f.account OR folder.type = '" + EntityFolder.OUTBOX + "')" + " AND (NOT message.ui_hide OR :debug)" + - " AND (NOT :filter_snoozed OR ui_snoozed IS NULL)" + + " AND (NOT :filter_snoozed OR ui_snoozed IS NULL OR folder.type = '" + EntityFolder.OUTBOX + "')" + " AND (NOT :found OR ui_found = :found)" + " GROUP BY CASE WHEN message.thread IS NULL OR NOT :threading THEN message.id ELSE message.thread END" + " HAVING SUM(CASE WHEN folder.id = :folder THEN 1 ELSE 0 END) > 0" + - " AND (NOT :filter_seen OR " + unseen_folder + " > 0)" + + " AND (NOT :filter_seen OR " + unseen_folder + " > 0 OR folder.type = '" + EntityFolder.OUTBOX + "')" + " ORDER BY" + " CASE" + " WHEN 'unread' = :sort THEN " + unseen_folder + " = 0" + diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 5f2de9c1d6..fab1daa2f4 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -2050,7 +2050,7 @@ public class FragmentMessages extends FragmentBase { else if ("size".equals(sort)) menu.findItem(R.id.menu_sort_on_size).setChecked(true); - menu.findItem(R.id.menu_filter).setVisible(viewType != AdapterMessage.ViewType.SEARCH); + menu.findItem(R.id.menu_filter).setVisible(viewType != AdapterMessage.ViewType.SEARCH && !outbox); menu.findItem(R.id.menu_filter_seen).setVisible(viewType != AdapterMessage.ViewType.THREAD); menu.findItem(R.id.menu_filter_snoozed).setVisible(viewType != AdapterMessage.ViewType.THREAD); menu.findItem(R.id.menu_filter_duplicates).setVisible(viewType == AdapterMessage.ViewType.THREAD);