mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-01 18:41:20 +01:00
Show all sender addresses
This commit is contained in:
@@ -599,17 +599,26 @@ public class MessageHelper {
|
||||
return "";
|
||||
|
||||
List<String> formatted = new ArrayList<>();
|
||||
for (Address address : addresses)
|
||||
if (address instanceof InternetAddress) {
|
||||
InternetAddress a = (InternetAddress) address;
|
||||
String personal = a.getPersonal();
|
||||
for (int i = 0; i < addresses.length; i++) {
|
||||
boolean duplicate = false;
|
||||
for (int j = 0; j < i; j++)
|
||||
if (addresses[i].equals(addresses[j])) {
|
||||
duplicate = true;
|
||||
break;
|
||||
}
|
||||
if (duplicate)
|
||||
continue;
|
||||
|
||||
if (addresses[i] instanceof InternetAddress) {
|
||||
InternetAddress address = (InternetAddress) addresses[i];
|
||||
String personal = address.getPersonal();
|
||||
if (TextUtils.isEmpty(personal))
|
||||
formatted.add(a.getAddress());
|
||||
formatted.add(address.getAddress());
|
||||
else {
|
||||
if (compose) {
|
||||
boolean quote = false;
|
||||
for (int i = 0; i < personal.length(); i++)
|
||||
if ("()<>,;:\\\"[]@".indexOf(personal.charAt(i)) >= 0) {
|
||||
for (int c = 0; c < personal.length(); c++)
|
||||
if ("()<>,;:\\\"[]@".indexOf(personal.charAt(c)) >= 0) {
|
||||
quote = true;
|
||||
break;
|
||||
}
|
||||
@@ -618,12 +627,13 @@ public class MessageHelper {
|
||||
}
|
||||
|
||||
if (full)
|
||||
formatted.add(personal + " <" + a.getAddress() + ">");
|
||||
formatted.add(personal + " <" + address.getAddress() + ">");
|
||||
else
|
||||
formatted.add(personal);
|
||||
}
|
||||
} else
|
||||
formatted.add(address.toString());
|
||||
formatted.add(addresses[i].toString());
|
||||
}
|
||||
return TextUtils.join(", ", formatted);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user