Removed address format exceptions for junk

This commit is contained in:
M66B 2021-10-20 07:34:21 +02:00
parent cdfbe9c76c
commit 67f08a6d61
1 changed files with 2 additions and 15 deletions

View File

@ -1216,8 +1216,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ivEncrypted.setVisibility(message.encrypted > 0 ? View.VISIBLE : View.GONE); ivEncrypted.setVisibility(message.encrypted > 0 ? View.VISIBLE : View.GONE);
MessageHelper.AddressFormat format = email_format; MessageHelper.AddressFormat format = email_format;
if (junk)
format = MessageHelper.AddressFormat.NAME_EMAIL;
if (show_recipients && recipients != null && recipients.length > 0) { if (show_recipients && recipients != null && recipients.length > 0) {
tvFrom.setText(context.getString(outgoing && viewType != ViewType.THREAD && compact tvFrom.setText(context.getString(outgoing && viewType != ViewType.THREAD && compact
@ -1908,7 +1906,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
boolean hasInbox = false; boolean hasInbox = false;
boolean hasArchive = false; boolean hasArchive = false;
boolean hasTrash = false; boolean hasTrash = false;
boolean hasJunk = false;
if (data.folders != null) if (data.folders != null)
for (EntityFolder folder : data.folders) for (EntityFolder folder : data.folders)
if (folder.selectable) if (folder.selectable)
@ -1918,8 +1915,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
hasArchive = true; hasArchive = true;
else if (EntityFolder.TRASH.equals(folder.type)) else if (EntityFolder.TRASH.equals(folder.type))
hasTrash = true; hasTrash = true;
else if (EntityFolder.JUNK.equals(folder.type))
hasJunk = true;
boolean inArchive = EntityFolder.ARCHIVE.equals(message.folderType); boolean inArchive = EntityFolder.ARCHIVE.equals(message.folderType);
boolean inSent = EntityFolder.SENT.equals(message.folderType); boolean inSent = EntityFolder.SENT.equals(message.folderType);
@ -2085,9 +2080,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private void bindAddresses(TupleMessageEx message) { private void bindAddresses(TupleMessageEx message) {
boolean show_addresses = properties.getValue("addresses", message.id); boolean show_addresses = properties.getValue("addresses", message.id);
boolean full = (show_addresses || boolean full = (show_addresses || email_format == MessageHelper.AddressFormat.NAME_EMAIL);
email_format == MessageHelper.AddressFormat.NAME_EMAIL ||
EntityFolder.JUNK.equals(message.folderType));
int froms = (message.from == null ? 0 : message.from.length); int froms = (message.from == null ? 0 : message.from.length);
int tos = (message.to == null ? 0 : message.to.length); int tos = (message.to == null ? 0 : message.to.length);
@ -5773,12 +5766,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
result.add(context.getString(R.string.title_accessibility_attachment)); result.add(context.getString(R.string.title_accessibility_attachment));
boolean outgoing = isOutgoing(message); boolean outgoing = isOutgoing(message);
boolean junk = EntityFolder.JUNK.equals(message.folderType);
Address[] addresses = (EntityFolder.isOutgoing(message.folderType) && Address[] addresses = (EntityFolder.isOutgoing(message.folderType) &&
(viewType != ViewType.THREAD || !threading) ? message.to : message.senders); (viewType != ViewType.THREAD || !threading) ? message.to : message.senders);
MessageHelper.AddressFormat format = email_format; MessageHelper.AddressFormat format = email_format;
if (junk)
format = MessageHelper.AddressFormat.NAME_EMAIL;
String from = MessageHelper.formatAddresses(addresses, format, false); String from = MessageHelper.formatAddresses(addresses, format, false);
// For a11y purpose subject is reported first when: user wishes so or this is a single outgoing message // For a11y purpose subject is reported first when: user wishes so or this is a single outgoing message
@ -5933,10 +5923,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
font_size_subject = Helper.getTextSize(context, fz_subject); font_size_subject = Helper.getTextSize(context, fz_subject);
this.subject_italic = prefs.getBoolean("subject_italic", true); this.subject_italic = prefs.getBoolean("subject_italic", true);
if (EntityFolder.JUNK.equals(type)) this.sender_ellipsize = prefs.getString("sender_ellipsize", "end");
this.sender_ellipsize = "full";
else
this.sender_ellipsize = prefs.getString("sender_ellipsize", "end");
this.subject_ellipsize = prefs.getString("subject_ellipsize", "full"); this.subject_ellipsize = prefs.getString("subject_ellipsize", "full");
this.keywords_header = prefs.getBoolean("keywords_header", false); this.keywords_header = prefs.getBoolean("keywords_header", false);
this.labels_header = prefs.getBoolean("labels_header", true); this.labels_header = prefs.getBoolean("labels_header", true);