Show cummulated priority/importance

pull/172/head
M66B 5 years ago
parent d9b6b0baf3
commit f588b964ac

@ -777,6 +777,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
Boolean.FALSE.equals(message.dmarc) ||
Boolean.FALSE.equals(message.mx));
boolean expanded = (viewType == ViewType.THREAD && properties.getValue("expanded", message.id));
Integer priority = (message.ui_importance == null ? message.ui_priority : message.ui_importance);
// Text size
if (textSize != 0) {
@ -878,7 +879,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibAvatar.setVisibility(avatars ? View.INVISIBLE : View.GONE);
// Line 1
Integer priority = (message.importance == null ? message.priority : message.importance);
ibAuth.setVisibility(authentication && !authenticated ? View.VISIBLE : View.GONE);
ivPriorityHigh.setVisibility(EntityMessage.PRIORITIY_HIGH.equals(priority) ? View.VISIBLE : View.GONE);
ivPriorityLow.setVisibility(EntityMessage.PRIORITIY_LOW.equals(priority) ? View.VISIBLE : View.GONE);
@ -3969,9 +3969,10 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
result.add(context.getString(R.string.title_accessibility_flagged));
}
if (EntityMessage.PRIORITIY_HIGH.equals(message.priority))
Integer priority = (message.ui_importance == null ? message.ui_priority : message.ui_importance);
if (EntityMessage.PRIORITIY_HIGH.equals(priority))
result.add(context.getString(R.string.title_legend_priority));
else if (EntityMessage.PRIORITIY_LOW.equals(message.priority))
else if (EntityMessage.PRIORITIY_LOW.equals(priority))
result.add(context.getString(R.string.title_legend_priority_low));
if (message.attachments > 0)
@ -4284,13 +4285,13 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
same = false;
Log.i("thread changed id=" + next.id);
}
if (!Objects.equals(prev.priority, next.priority)) {
if (!Objects.equals(prev.ui_priority, next.ui_priority)) {
same = false;
Log.i("priority changed id=" + next.id);
Log.i("ui_priority changed id=" + next.id);
}
if (!Objects.equals(prev.importance, next.importance)) {
if (!Objects.equals(prev.ui_importance, next.ui_importance)) {
same = false;
Log.i("importance changed id=" + next.id);
Log.i("ui_importance changed id=" + next.id);
}
if (!Objects.equals(prev.receipt_request, next.receipt_request)) {
same = false;

@ -56,6 +56,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" +
" ((:found AND folder.type <> '" + 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" +

@ -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;

Loading…
Cancel
Save