Browse Source

Reply all

main
M66B 6 years ago
parent
commit
17c37807bd
2 changed files with 20 additions and 3 deletions
  1. +19
    -2
      app/src/main/java/eu/faircode/email/FragmentCompose.java
  2. +1
    -1
      app/src/main/java/eu/faircode/email/FragmentMessage.java

+ 19
- 2
app/src/main/java/eu/faircode/email/FragmentCompose.java View File

@ -71,6 +71,7 @@ import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.Date; import java.util.Date;
@ -748,8 +749,24 @@ public class FragmentCompose extends FragmentEx {
draft.replying = ref.id; draft.replying = ref.id;
draft.to = (ref.reply == null || ref.reply.length == 0 ? ref.from : ref.reply); draft.to = (ref.reply == null || ref.reply.length == 0 ? ref.from : ref.reply);
draft.from = ref.to; 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)) { } else if ("forward".equals(action)) {
//msg.replying = ref.id; //msg.replying = ref.id;


+ 1
- 1
app/src/main/java/eu/faircode/email/FragmentMessage.java View File

@ -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).setChecked(headers);
menu.findItem(R.id.menu_show_headers).setEnabled(message.uid != null); 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_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); menu.findItem(R.id.menu_decrypt).setVisible(!inOutbox);
} }


Loading…
Cancel
Save