Consider messages in archive as seen

This commit is contained in:
M66B 2018-09-19 14:13:09 +00:00
parent 0035b0e9fe
commit bcae943c1b
1 changed files with 2 additions and 0 deletions

View File

@ -40,6 +40,7 @@ public interface DaoMessage {
", folder.name as folderName, folder.type as folderType" +
", COUNT(message.id) as count" +
", SUM(CASE WHEN message.ui_seen" +
" OR folder.type = '" + EntityFolder.ARCHIVE + "'" +
" OR folder.type = '" + EntityFolder.OUTBOX + "'" +
" OR folder.type = '" + EntityFolder.DRAFTS + "' THEN 0 ELSE 1 END) as unseen" +
", (SELECT COUNT(a.id) FROM attachment a WHERE a.message = message.id) AS attachments" +
@ -63,6 +64,7 @@ public interface DaoMessage {
", folder.name as folderName, folder.type as folderType" +
", COUNT(message.id) as count" +
", SUM(CASE WHEN message.ui_seen" +
" OR (folder.id <> :folder AND folder.type = '" + EntityFolder.ARCHIVE + "')" +
" OR (folder.id <> :folder AND folder.type = '" + EntityFolder.OUTBOX + "')" +
" OR (folder.id <> :folder AND folder.type = '" + EntityFolder.DRAFTS + "') THEN 0 ELSE 1 END) as unseen" +
", (SELECT COUNT(a.id) FROM attachment a WHERE a.message = message.id) AS attachments" +