Filter group addresses

pull/214/head
M66B 11 months ago
parent 02cf9ea6d3
commit dd14c677dc

@ -5583,6 +5583,12 @@ public class FragmentCompose extends FragmentBase {
// - receipt // - receipt
// - participation // - participation
ref.from = MessageHelper.removeGroups(ref.from);
ref.reply = MessageHelper.removeGroups(ref.reply);
ref.to = MessageHelper.removeGroups(ref.to);
ref.cc = MessageHelper.removeGroups(ref.cc);
ref.bcc = MessageHelper.removeGroups(ref.bcc);
// References // References
if ("reply".equals(action) || "reply_all".equals(action) || if ("reply".equals(action) || "reply_all".equals(action) ||
"list".equals(action) || "list".equals(action) ||

@ -5487,6 +5487,21 @@ public class MessageHelper {
return result.toArray(new InternetAddress[0]); return result.toArray(new InternetAddress[0]);
} }
static Address[] removeGroups(Address[] addresses) {
if (addresses == null)
return null;
List<Address> result = new ArrayList<>();
for (Address address : addresses) {
if (address instanceof InternetAddress && ((InternetAddress) address).isGroup())
continue;
result.add(address);
}
return result.toArray(new Address[0]);
}
static void getStructure(Part part, SpannableStringBuilder ssb, int level, int textColorLink) { static void getStructure(Part part, SpannableStringBuilder ssb, int level, int textColorLink) {
try { try {
Enumeration<Header> headers; Enumeration<Header> headers;

Loading…
Cancel
Save