diff --git a/app/src/main/java/eu/faircode/email/DaoFolder.java b/app/src/main/java/eu/faircode/email/DaoFolder.java index d3beec07ea..fc5e4cf92e 100644 --- a/app/src/main/java/eu/faircode/email/DaoFolder.java +++ b/app/src/main/java/eu/faircode/email/DaoFolder.java @@ -111,8 +111,8 @@ public interface DaoFolder { @Query("SELECT folder.*" + ", account.`order` AS accountOrder, account.name AS accountName" + - ", SUM(CASE WHEN NOT message.ui_hide THEN 1 ELSE 0 END) AS messages" + - ", SUM(CASE WHEN NOT message.ui_seen AND NOT message.ui_hide THEN 1 ELSE 0 END) AS unseen" + + ", COUNT(message.id) AS messages" + + ", SUM(CASE WHEN NOT message.ui_seen THEN 1 ELSE 0 END) AS unseen" + ", SUM(CASE WHEN message.ui_snoozed IS NULL THEN 0 ELSE 1 END) AS snoozed" + ", (SELECT COUNT(operation.id) FROM operation WHERE operation.folder = folder.id) AS operations" + ", (SELECT COUNT(operation.id) FROM operation WHERE operation.folder = folder.id AND operation.state = 'executing') AS executing" + @@ -155,7 +155,7 @@ public interface DaoFolder { List getSystemFolders(long account); @Query("SELECT folder.type" + - ", SUM(CASE WHEN NOT message.ui_hide THEN 1 ELSE 0 END) AS messages" + + ", COUNT(message.id) AS messages" + ", SUM(CASE WHEN NOT message.ui_seen AND NOT message.ui_hide THEN 1 ELSE 0 END) AS unseen" + " FROM folder" + " JOIN account ON account.id = folder.account" +