Prefer found non archived messages

This commit is contained in:
M66B 2019-08-21 07:56:46 +02:00
parent 95acd73df8
commit 4342da4a14
1 changed files with 1 additions and 1 deletions

View File

@ -50,7 +50,7 @@ public interface DaoMessage {
", COUNT(DISTINCT CASE WHEN message.msgid IS NULL THEN message.id ELSE message.msgid END) AS visible" +
", SUM(message.size) AS totalSize" +
", MAX(CASE WHEN" +
" ((:found AND folder.type <> '" + EntityFolder.DRAFTS + "')" +
" ((:found AND folder.type <> '" + EntityFolder.ARCHIVE + "' AND folder.type <> '" + EntityFolder.DRAFTS + "')" +
" OR (NOT :found AND :type IS NULL AND folder.unified)" +
" OR (NOT :found AND folder.type = :type))" +
" THEN message.received ELSE 0 END) AS dummy" +