1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-27 10:17:18 +00:00

Unexposed implies unread

This commit is contained in:
M66B 2024-03-03 10:46:48 +01:00
parent 6413440692
commit 8ddaa84bae
2 changed files with 8 additions and 7 deletions

View file

@ -80,7 +80,8 @@ public interface DaoAccount {
" JOIN folder ON folder.id = message.folder" +
" WHERE message.account = account.id" +
" AND folder.type <> '" + EntityFolder.OUTBOX + "'" +
" AND message.received > folder.last_view" +
" AND folder.count_unread" +
" AND NOT ui_seen AND message.received > folder.last_view" +
" AND NOT ui_hide) AS unexposed" +
" FROM account" +
" LEFT JOIN folder AS drafts ON drafts.account = account.id AND drafts.type = '" + EntityFolder.DRAFTS + "'" +
@ -114,7 +115,7 @@ public interface DaoAccount {
" ELSE message.id END)" +
" FROM message" +
" WHERE message.folder = folder.id" +
" AND message.received > folder.last_view" +
" AND NOT message.ui_seen AND message.received > folder.last_view" +
" AND NOT ui_hide) AS unexposed" +
" FROM account" +
" JOIN folder ON folder.account = account.id" +

View file

@ -44,7 +44,7 @@ public interface DaoFolder {
", COUNT(DISTINCT message.id) AS messages" +
", COUNT(DISTINCT CASE WHEN message.content = 1 THEN message.id ELSE NULL END) AS content" +
", COUNT(DISTINCT CASE WHEN NOT message.ui_seen THEN message.id ELSE NULL END) AS unseen" +
", COUNT(DISTINCT CASE WHEN message.received > folder.last_view THEN message.id ELSE NULL END) AS unexposed" +
", COUNT(DISTINCT CASE WHEN NOT message.ui_seen AND message.received > folder.last_view THEN message.id ELSE NULL END) AS unexposed" +
", COUNT(DISTINCT CASE WHEN message.ui_flagged THEN message.id ELSE NULL END) AS flagged" +
", COUNT(DISTINCT CASE WHEN operation.state = 'executing' THEN operation.id ELSE NULL END) AS executing" +
" FROM folder" +
@ -85,7 +85,7 @@ public interface DaoFolder {
", COUNT(DISTINCT CASE WHEN message.ui_hide THEN NULL ELSE message.id END) AS messages" +
", COUNT(DISTINCT CASE WHEN message.content = 1 AND NOT message.ui_hide THEN message.id ELSE NULL END) AS content" +
", COUNT(DISTINCT CASE WHEN NOT message.ui_seen AND NOT message.ui_hide THEN message.id ELSE NULL END) AS unseen" +
", COUNT(DISTINCT CASE WHEN message.received > folder.last_view AND NOT message.ui_hide THEN message.id ELSE NULL END) AS unexposed" +
", COUNT(DISTINCT CASE WHEN NOT message.ui_seen AND NOT message.ui_hide AND message.received > folder.last_view THEN message.id ELSE NULL END) AS unexposed" +
", COUNT(DISTINCT CASE WHEN message.ui_flagged AND NOT message.ui_hide THEN message.id ELSE NULL END) AS flagged" +
", COUNT(DISTINCT CASE WHEN operation.state = 'executing' THEN operation.id ELSE NULL END) AS executing" +
" FROM folder" +
@ -110,7 +110,7 @@ public interface DaoFolder {
", COUNT(DISTINCT message.id) AS messages" +
", COUNT(DISTINCT CASE WHEN message.content = 1 THEN message.id ELSE NULL END) AS content" +
", COUNT(DISTINCT CASE WHEN NOT message.ui_seen THEN message.id ELSE NULL END) AS unseen" +
", COUNT(DISTINCT CASE WHEN message.received > folder.last_view THEN message.id ELSE NULL END) AS unexposed" +
", COUNT(DISTINCT CASE WHEN NOT message.ui_seen AND message.received > folder.last_view THEN message.id ELSE NULL END) AS unexposed" +
", COUNT(DISTINCT CASE WHEN message.ui_flagged THEN message.id ELSE NULL END) AS flagged" +
", COUNT(DISTINCT CASE WHEN operation.state = 'executing' THEN operation.id ELSE NULL END) AS executing" +
" FROM folder" +
@ -144,7 +144,7 @@ public interface DaoFolder {
", COUNT(DISTINCT message.id) AS messages" +
", COUNT(DISTINCT CASE WHEN message.content = 1 THEN message.id ELSE NULL END) AS content" +
", COUNT(DISTINCT CASE WHEN NOT message.ui_seen THEN message.id ELSE NULL END) AS unseen" +
", COUNT(DISTINCT CASE WHEN message.received > folder.last_view THEN message.id ELSE NULL END) AS unexposed" +
", COUNT(DISTINCT CASE WHEN NOT message.ui_seen AND message.received > folder.last_view THEN message.id ELSE NULL END) AS unexposed" +
", COUNT(DISTINCT CASE WHEN message.ui_flagged THEN message.id ELSE NULL END) AS flagged" +
", COUNT(DISTINCT CASE WHEN operation.state = 'executing' THEN operation.id ELSE NULL END) AS executing" +
" FROM folder" +
@ -194,7 +194,7 @@ public interface DaoFolder {
", COUNT(DISTINCT folder.id) AS folders" +
", COUNT(message.id) AS messages" +
", SUM(CASE WHEN NOT message.ui_seen THEN 1 ELSE 0 END) AS unseen" +
", SUM(CASE WHEN message.received > folder.last_view THEN 1 ELSE 0 END) AS unexposed" +
", SUM(CASE WHEN NOT message.ui_seen AND message.received > folder.last_view THEN 1 ELSE 0 END) AS unexposed" +
", CASE WHEN folder.account IS NULL THEN folder.sync_state ELSE NULL END AS sync_state" +
", folder.color, COUNT (DISTINCT folder.color) AS colorCount" +
" FROM folder" +