Refactoring

pull/214/head
M66B 9 months ago
parent d42249bbd5
commit b3a384b346

@ -349,6 +349,17 @@ public class EntityMessage implements Serializable {
return addresses.toArray(new Address[0]); return addresses.toArray(new Address[0]);
} }
List<Address> getAllRecipients() {
List<Address> recipients = new ArrayList<>();
if (to != null)
recipients.addAll(Arrays.asList(to));
if (cc != null)
recipients.addAll(Arrays.asList(cc));
if (bcc != null)
recipients.addAll(Arrays.asList(bcc));
return recipients;
}
boolean hasKeyword(@NonNull String value) { boolean hasKeyword(@NonNull String value) {
// https://tools.ietf.org/html/rfc5788 // https://tools.ietf.org/html/rfc5788
if (keywords == null) if (keywords == null)

@ -5804,13 +5804,7 @@ public class FragmentCompose extends FragmentBase {
data.draft.plain_only = 1; data.draft.plain_only = 1;
// Encryption // Encryption
List<Address> recipients = new ArrayList<>(); List<Address> recipients = data.draft.getAllRecipients();
if (data.draft.to != null)
recipients.addAll(Arrays.asList(data.draft.to));
if (data.draft.cc != null)
recipients.addAll(Arrays.asList(data.draft.cc));
if (data.draft.bcc != null)
recipients.addAll(Arrays.asList(data.draft.bcc));
if (!BuildConfig.DEBUG) if (!BuildConfig.DEBUG)
if (EntityMessage.PGP_SIGNONLY.equals(ref.ui_encrypt) || if (EntityMessage.PGP_SIGNONLY.equals(ref.ui_encrypt) ||
@ -7089,13 +7083,7 @@ public class FragmentCompose extends FragmentBase {
// identity != null && identity.sender_extra) // identity != null && identity.sender_extra)
// args.putBoolean("remind_extra", true); // args.putBoolean("remind_extra", true);
List<Address> recipients = new ArrayList<>(); List<Address> recipients = draft.getAllRecipients();
if (draft.to != null)
recipients.addAll(Arrays.asList(draft.to));
if (draft.cc != null)
recipients.addAll(Arrays.asList(draft.cc));
if (draft.bcc != null)
recipients.addAll(Arrays.asList(draft.bcc));
args.putBoolean("remind_noreply", MessageHelper.isNoReply(recipients)); args.putBoolean("remind_noreply", MessageHelper.isNoReply(recipients));

Loading…
Cancel
Save