From f588b964ac12a2d8bf15ca88203953e13c82769c Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 1 Feb 2020 14:29:47 +0100 Subject: [PATCH] Show cummulated priority/importance --- .../java/eu/faircode/email/AdapterMessage.java | 15 ++++++++------- .../main/java/eu/faircode/email/DaoMessage.java | 10 ++++++++++ .../java/eu/faircode/email/TupleMessageEx.java | 4 ++++ 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index a91e85e664..fc1f241137 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -777,6 +777,7 @@ public class AdapterMessage extends RecyclerView.Adapter 0) @@ -4284,13 +4285,13 @@ public class AdapterMessage extends RecyclerView.Adapter '" + EntityFolder.ARCHIVE + "' AND folder.type <> '" + EntityFolder.DRAFTS + "')" + " OR (NOT :found AND :type IS NULL AND folder.unified)" + @@ -112,6 +114,8 @@ public interface DaoMessage { ", (message.ui_encrypt IN (1, 3)) AS encrypted" + ", COUNT(DISTINCT CASE WHEN message.msgid IS NULL THEN message.id ELSE message.msgid END) AS visible" + ", SUM(message.total) AS totalSize" + + ", MAX(message.priority) AS ui_priority" + + ", MAX(message.importance) AS ui_importance" + ", MAX(CASE WHEN folder.id = :folder THEN message.received ELSE 0 END) AS dummy" + " FROM (SELECT * FROM message ORDER BY received DESC) AS message" + " JOIN account_view AS account ON account.id = message.account" + @@ -162,6 +166,8 @@ public interface DaoMessage { ", (message.ui_encrypt IN (1, 3)) AS encrypted" + ", 1 AS visible" + ", message.total AS totalSize" + + ", message.priority AS ui_priority" + + ", message.importance AS ui_importance" + " FROM message" + " JOIN account_view AS account ON account.id = message.account" + " LEFT JOIN identity_view AS identity ON identity.id = message.identity" + @@ -316,6 +322,8 @@ public interface DaoMessage { ", (message.ui_encrypt IN (1, 3)) AS encrypted" + ", 1 AS visible" + ", message.total AS totalSize" + + ", message.priority AS ui_priority" + + ", message.importance AS ui_importance" + " FROM message" + " JOIN account_view AS account ON account.id = message.account" + " LEFT JOIN identity_view AS identity ON identity.id = message.identity" + @@ -367,6 +375,8 @@ public interface DaoMessage { ", (message.ui_encrypt IN (1, 3)) AS encrypted" + ", 1 AS visible" + ", message.total AS totalSize" + + ", message.priority AS ui_priority" + + ", message.importance AS ui_importance" + " FROM message" + " JOIN account_view AS account ON account.id = message.account" + " LEFT JOIN identity_view AS identity ON identity.id = message.identity" + diff --git a/app/src/main/java/eu/faircode/email/TupleMessageEx.java b/app/src/main/java/eu/faircode/email/TupleMessageEx.java index 30a8a82035..a31364abe6 100644 --- a/app/src/main/java/eu/faircode/email/TupleMessageEx.java +++ b/app/src/main/java/eu/faircode/email/TupleMessageEx.java @@ -54,6 +54,8 @@ public class TupleMessageEx extends EntityMessage { public int encrypted; public int visible; public Long totalSize; + public Integer ui_priority; + public Integer ui_importance; @Ignore boolean duplicate; @@ -109,6 +111,8 @@ public class TupleMessageEx extends EntityMessage { this.encrypted == other.encrypted && this.visible == other.visible && Objects.equals(this.totalSize, other.totalSize) && + Objects.equals(this.ui_priority, other.ui_priority) && + Objects.equals(this.ui_importance, other.ui_importance) && this.duplicate == other.duplicate); } return false;