Skip sorting on importance when searching

This commit is contained in:
M66B 2022-12-16 20:19:11 +01:00
parent 1c32eee3bc
commit 9e31b33f7d
1 changed files with 2 additions and 2 deletions

View File

@ -101,7 +101,7 @@ public interface DaoMessage {
" AND (NOT :filter_snoozed OR message.ui_snoozed IS NULL OR " + is_drafts + ")" +
" AND (NOT :filter_deleted OR NOT message.ui_deleted)" +
" AND (:filter_language IS NULL OR SUM(message.language = :filter_language) > 0)" +
" ORDER BY -IFNULL(message.importance, 1)" +
" ORDER BY CASE WHEN :found THEN 0 ELSE -IFNULL(message.importance, 1) END" +
", CASE WHEN :group_category THEN account.category ELSE '' END COLLATE NOCASE" +
", CASE" +
" WHEN 'unread' = :sort THEN SUM(1 - message.ui_seen) = 0" +
@ -176,7 +176,7 @@ public interface DaoMessage {
" AND (NOT :filter_snoozed OR message.ui_snoozed IS NULL OR " + is_outbox + " OR " + is_drafts + ")" +
" AND (NOT :filter_deleted OR NOT message.ui_deleted)" +
" AND (:filter_language IS NULL OR SUM(message.language = :filter_language) > 0 OR " + is_outbox + ")" +
" ORDER BY -IFNULL(message.importance, 1)" +
" ORDER BY CASE WHEN :found THEN 0 ELSE -IFNULL(message.importance, 1) END" +
", CASE" +
" WHEN 'unread' = :sort THEN SUM(1 - message.ui_seen) = 0" +
" WHEN 'starred' = :sort THEN COUNT(message.id) - SUM(1 - message.ui_flagged) = 0" +