mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-24 15:11:03 +00:00
Reply all
This commit is contained in:
parent
30be70fec6
commit
17c37807bd
2 changed files with 20 additions and 3 deletions
|
@ -71,6 +71,7 @@ import java.io.InputStream;
|
|||
import java.io.OutputStream;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
|
@ -748,8 +749,24 @@ public class FragmentCompose extends FragmentEx {
|
|||
draft.replying = ref.id;
|
||||
draft.to = (ref.reply == null || ref.reply.length == 0 ? ref.from : ref.reply);
|
||||
draft.from = ref.to;
|
||||
if ("reply_all".equals(action))
|
||||
draft.cc = ref.cc;
|
||||
|
||||
if ("reply_all".equals(action)) {
|
||||
List<Address> addresses = new ArrayList<>();
|
||||
if (ref.to != null)
|
||||
addresses.addAll(Arrays.asList(ref.to));
|
||||
if (ref.cc != null)
|
||||
addresses.addAll(Arrays.asList(ref.cc));
|
||||
List<EntityIdentity> identities = db.identity().getIdentities();
|
||||
for (Address address : new ArrayList<>(addresses)) {
|
||||
String cc = Helper.canonicalAddress(((InternetAddress) address).getAddress());
|
||||
for (EntityIdentity identity : identities) {
|
||||
String email = Helper.canonicalAddress(identity.email);
|
||||
if (cc.equals(email))
|
||||
addresses.remove(address);
|
||||
}
|
||||
}
|
||||
draft.cc = addresses.toArray(new Address[0]);
|
||||
}
|
||||
|
||||
} else if ("forward".equals(action)) {
|
||||
//msg.replying = ref.id;
|
||||
|
|
|
@ -574,7 +574,7 @@ public class FragmentMessage extends FragmentEx {
|
|||
menu.findItem(R.id.menu_show_headers).setChecked(headers);
|
||||
menu.findItem(R.id.menu_show_headers).setEnabled(message.uid != null);
|
||||
menu.findItem(R.id.menu_show_headers).setVisible(!free);
|
||||
menu.findItem(R.id.menu_reply_all).setVisible(message.cc != null && !inOutbox);
|
||||
menu.findItem(R.id.menu_reply_all).setVisible(!inOutbox);
|
||||
menu.findItem(R.id.menu_decrypt).setVisible(!inOutbox);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue