Show number of additional recipients

pull/175/head
M66B 5 years ago
parent 482a65ddf3
commit 4148b28f61

@ -784,6 +784,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
boolean outbox = EntityFolder.OUTBOX.equals(message.folderType);
boolean outgoing = isOutgoing(message);
Address[] addresses = (outgoing && (viewType != ViewType.THREAD || !threading) ? message.to : message.senders);
int recipients = (message.to == null || message.to.length < 2 ? 0 : message.to.length - 1) +
(message.cc == null ? 0 : message.cc.length) +
(message.bcc == null ? 0 : message.bcc.length);
boolean authenticated =
!(Boolean.FALSE.equals(message.dkim) ||
Boolean.FALSE.equals(message.spf) ||
@ -907,7 +910,11 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
? View.VISIBLE : View.GONE);
ivSigned.setVisibility(message.signed > 0 ? View.VISIBLE : View.GONE);
ivEncrypted.setVisibility(message.encrypted > 0 ? View.VISIBLE : View.GONE);
if (recipients == 0 || viewType != ViewType.THREAD)
tvFrom.setText(MessageHelper.formatAddresses(addresses, name_email, false));
else
tvFrom.setText(context.getString(R.string.title_name_plus,
MessageHelper.formatAddresses(addresses, name_email, false), recipients));
tvFrom.setPaintFlags(tvFrom.getPaintFlags() & ~Paint.UNDERLINE_TEXT_FLAG);
tvSize.setText(message.totalSize == null ? null : Helper.humanReadableByteCount(message.totalSize, true));
tvSize.setVisibility(

@ -4608,7 +4608,11 @@ public class FragmentCompose extends FragmentBase {
int to = (draft.to == null ? 0 : draft.to.length);
int cc = (draft.cc == null ? 0 : draft.cc.length) + (draft.bcc == null ? 0 : draft.bcc.length);
tvTo.setText(MessageHelper.formatAddressesShort(draft.to) + (cc > 0 ? " +" + cc : ""));
if (cc == 0)
tvTo.setText(MessageHelper.formatAddressesShort(draft.to));
else
tvTo.setText(getString(R.string.title_name_plus,
MessageHelper.formatAddressesShort(draft.to), cc));
tvTo.setTextColor(Helper.resolveColor(getContext(),
to + cc > RECIPIENTS_WARNING ? R.attr.colorWarning : android.R.attr.textColorPrimary));
tvVia.setText(draft.identityEmail);

@ -99,6 +99,7 @@
<string name="title_notification_alert">\'%1$s\' server alert</string>
<string name="title_name_count">%1$s (%2$s)</string>
<string name="title_name_plus">%1$s +%2$d</string>
<string name="title_factor_minutes">%1$d minutes</string>
<string name="menu_exit">Exit</string>

Loading…
Cancel
Save