diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index 1ce7ab3c28..3d4efd09de 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -3231,9 +3231,9 @@ public class AdapterMessage extends RecyclerView.Adapter 1); + popupMenu.getMenu().findItem(R.id.menu_reply_to_all).setVisible(all.length > 0); popupMenu.getMenu().findItem(R.id.menu_reply_list).setVisible(data.message.list_post != null); popupMenu.getMenu().findItem(R.id.menu_reply_receipt).setVisible(data.message.receipt_to != null); popupMenu.getMenu().findItem(R.id.menu_reply_answer).setVisible(answers != 0 || !Helper.isPro(context)); diff --git a/app/src/main/java/eu/faircode/email/EntityMessage.java b/app/src/main/java/eu/faircode/email/EntityMessage.java index 08768239e6..86059527ec 100644 --- a/app/src/main/java/eu/faircode/email/EntityMessage.java +++ b/app/src/main/java/eu/faircode/email/EntityMessage.java @@ -32,7 +32,10 @@ import androidx.room.PrimaryKey; import java.io.File; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import java.util.Date; +import java.util.List; import java.util.Objects; import java.util.Random; @@ -156,6 +159,19 @@ public class EntityMessage implements Serializable { return sb.toString(); } + Address[] getAll() { + List
addresses = new ArrayList<>(); + if (reply != null && reply.length > 0) + addresses.addAll(Arrays.asList(reply)); + else if (to != null) + addresses.addAll(Arrays.asList(to)); + + if (cc != null) + addresses.addAll(Arrays.asList(cc)); + + return addresses.toArray(new Address[0]); + } + File getFile(Context context) { File dir = new File(context.getFilesDir(), "messages"); if (!dir.exists()) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 88aa31d68b..39ff84ad49 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -2064,25 +2064,11 @@ public class FragmentCompose extends FragmentBase { } } - if ("reply_all".equals(action)) { - // Remove self from cc - List
ccs = new ArrayList<>(); - if (ref.cc != null) - ccs.addAll(Arrays.asList(ref.cc)); - - for (Address cc : new ArrayList<>(ccs)) { - String email = MessageHelper.canonicalAddress(((InternetAddress) cc).getAddress()); - List identities = db.identity().getComposableIdentities(ref.account); - for (EntityIdentity identity : identities) { - String iemail = MessageHelper.canonicalAddress(identity.email); - if (email.equals(iemail)) - ccs.remove(cc); - } - } - draft.cc = ccs.toArray(new Address[0]); - } else if ("receipt".equals(action)) { + if ("reply_all".equals(action)) + draft.cc = ref.getAll(); + else if ("receipt".equals(action)) draft.receipt_request = true; - } + } else if ("forward".equals(action)) { draft.thread = draft.msgid; // new thread draft.from = ref.to;