Mark messages with failed DKIM, SPF or DMARC authentication

This commit is contained in:
M66B
2019-04-12 16:15:42 +02:00
parent c312725446
commit a29de1bd3f
8 changed files with 1744 additions and 1 deletions

View File

@@ -167,6 +167,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
View.OnClickListener, View.OnLongClickListener, BottomNavigationView.OnNavigationItemSelectedListener {
private View view;
private View vwColor;
private View vwStatus;
private ImageView ivExpander;
private ImageView ivFlagged;
private ImageView ivAvatar;
@@ -250,6 +251,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
view = itemView.findViewById(R.id.clItem);
vwColor = itemView.findViewById(R.id.vwColor);
vwStatus = itemView.findViewById(R.id.vwStatus);
ivExpander = itemView.findViewById(R.id.ivExpander);
ivFlagged = itemView.findViewById(R.id.ivFlagged);
ivAvatar = itemView.findViewById(R.id.ivAvatar);
@@ -405,6 +407,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private void clear() {
vwColor.setVisibility(View.GONE);
vwStatus.setVisibility(View.GONE);
ivExpander.setVisibility(View.GONE);
ivFlagged.setVisibility(View.GONE);
ivAvatar.setVisibility(View.GONE);
@@ -499,6 +502,13 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
vwColor.setBackgroundColor(message.accountColor == null ? Color.TRANSPARENT : message.accountColor);
vwColor.setVisibility(View.VISIBLE);
vwStatus.setBackgroundColor(
Boolean.FALSE.equals(message.dkim) ||
Boolean.FALSE.equals(message.spf) ||
Boolean.FALSE.equals(message.dmarc)
? colorWarning : Color.TRANSPARENT);
vwStatus.setVisibility(View.VISIBLE);
// Expander
boolean expanded = (viewType == ViewType.THREAD && properties.getValue("expanded", message.id));
ivExpander.setImageResource(expanded ? R.drawable.baseline_expand_less_24 : R.drawable.baseline_expand_more_24);