From d5a2e09eae5881a9b0d407bd5dc38680706d87b1 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 20 Feb 2019 09:04:44 +0000 Subject: [PATCH] Fixed counting null message IDs --- app/src/main/java/eu/faircode/email/DaoMessage.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/DaoMessage.java b/app/src/main/java/eu/faircode/email/DaoMessage.java index ef685b2ada..9c43f1014e 100644 --- a/app/src/main/java/eu/faircode/email/DaoMessage.java +++ b/app/src/main/java/eu/faircode/email/DaoMessage.java @@ -55,7 +55,7 @@ public interface DaoMessage { ", " + unflagged_unified + " AS unflagged" + ", (SELECT COUNT(a.id) FROM attachment a WHERE a.message = message.id) AS attachments" + ", SUM(CASE WHEN folder.type = '" + EntityFolder.DRAFTS + "' THEN 1 ELSE 0 END) AS drafts" + - ", COUNT(DISTINCT message.msgid) AS visible" + + ", COUNT(DISTINCT CASE WHEN message.msgid IS NULL THEN '' ELSE message.msgid END) AS visible" + ", MAX(CASE WHEN :found OR folder.unified THEN message.received ELSE 0 END) AS dummy" + " FROM message" + " JOIN account ON account.id = message.account" + @@ -95,7 +95,7 @@ public interface DaoMessage { ", " + unflagged_folder + " AS unflagged" + ", (SELECT COUNT(a.id) FROM attachment a WHERE a.message = message.id) AS attachments" + ", SUM(CASE WHEN folder.type = '" + EntityFolder.DRAFTS + "' THEN 1 ELSE 0 END) AS drafts" + - ", COUNT(DISTINCT message.msgid) AS visible" + + ", COUNT(DISTINCT CASE WHEN message.msgid IS NULL THEN '' ELSE message.msgid END) AS visible" + ", MAX(CASE WHEN folder.id = :folder THEN message.received ELSE 0 END) AS dummy" + " FROM message" + " JOIN account ON account.id = message.account" +