From 23bd903965f281920cf028c972993943e0979d4a Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 25 Jan 2020 13:48:21 +0100 Subject: [PATCH] Fixed sorting on size --- 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 8e217f869d..25b9333188 100644 --- a/app/src/main/java/eu/faircode/email/DaoMessage.java +++ b/app/src/main/java/eu/faircode/email/DaoMessage.java @@ -81,7 +81,7 @@ public interface DaoMessage { " WHEN 'starred' = :sort THEN COUNT(message.id) - SUM(1 - message.ui_flagged) = 0" + " WHEN 'sender' = :sort THEN LOWER(message.sender)" + " WHEN 'subject' = :sort THEN LOWER(message.subject)" + - " WHEN 'size' = :sort THEN -SUM(message.size)" + + " WHEN 'size' = :sort THEN -SUM(message.total)" + " WHEN 'snoozed' = :sort THEN SUM(CASE WHEN message.ui_snoozed IS NULL THEN 0 ELSE 1 END) = 0" + " ELSE 0" + " END, CASE WHEN :ascending THEN message.received ELSE -message.received END") @@ -128,7 +128,7 @@ public interface DaoMessage { " WHEN 'starred' = :sort THEN COUNT(message.id) - SUM(1 - message.ui_flagged) = 0" + " WHEN 'sender' = :sort THEN LOWER(message.sender)" + " WHEN 'subject' = :sort THEN LOWER(message.subject)" + - " WHEN 'size' = :sort THEN -SUM(message.size)" + + " WHEN 'size' = :sort THEN -SUM(message.total)" + " WHEN 'snoozed' = :sort THEN SUM(CASE WHEN message.ui_snoozed IS NULL THEN 0 ELSE 1 END) = 0" + " ELSE 0" + " END, CASE WHEN :ascending THEN message.received ELSE -message.received END")