From 43077578f23a2e87ea44ac4d0ae6b084e6dc4645 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 8 Mar 2019 09:49:44 +0000 Subject: [PATCH] Confirm send plus --- .../eu/faircode/email/FragmentCompose.java | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 67893cce05..7d4360989d 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -989,7 +989,22 @@ public class FragmentCompose extends FragmentBase { throw new IllegalArgumentException(getString(R.string.title_from_missing)); String to = etTo.getText().toString(); - InternetAddress ato[] = (TextUtils.isEmpty(to) ? new InternetAddress[0] : InternetAddress.parse(to)); + String cc = etCc.getText().toString(); + String bcc = etBcc.getText().toString(); + + InternetAddress ato[] = new InternetAddress[0]; + InternetAddress acc[] = new InternetAddress[0]; + InternetAddress abcc[] = new InternetAddress[0]; + + if (!TextUtils.isEmpty(to)) + ato = InternetAddress.parse(to); + + if (!TextUtils.isEmpty(cc)) + acc = InternetAddress.parse(cc); + + if (!TextUtils.isEmpty(bcc)) + abcc = InternetAddress.parse(bcc); + if (ato.length == 0) throw new IllegalArgumentException(getString(R.string.title_to_missing)); @@ -997,8 +1012,10 @@ public class FragmentCompose extends FragmentBase { final TextView tvMessage = dview.findViewById(R.id.tvMessage); final CheckBox cbNotAgain = dview.findViewById(R.id.cbNotAgain); + int plus = acc.length + abcc.length; + tvMessage.setText(getString(R.string.title_ask_send_via, - MessageHelper.formatAddressesShort(ato), ident.email)); + MessageHelper.formatAddressesShort(ato) + (plus > 0 ? " +" + plus : ""), ident.email)); new DialogBuilderLifecycle(getContext(), getViewLifecycleOwner()) .setView(dview)