mirror of https://github.com/M66B/FairEmail.git
Simplification
This commit is contained in:
parent
12076cdffb
commit
340c2ab2ad
|
@ -222,19 +222,18 @@ public class MessageHelper {
|
||||||
String email = ((InternetAddress) message.from[0]).getAddress();
|
String email = ((InternetAddress) message.from[0]).getAddress();
|
||||||
String name = ((InternetAddress) message.from[0]).getPersonal();
|
String name = ((InternetAddress) message.from[0]).getPersonal();
|
||||||
if (identity != null && identity.sender_extra &&
|
if (identity != null && identity.sender_extra &&
|
||||||
identity.email.contains("@") &&
|
email != null && message.extra != null) {
|
||||||
email != null &&
|
|
||||||
email.contains("@") &&
|
|
||||||
message.extra != null &&
|
|
||||||
!message.extra.equals(identity.email.split("@")[0])) {
|
|
||||||
int at = email.indexOf('@');
|
int at = email.indexOf('@');
|
||||||
if (message.extra.length() > 1 && message.extra.startsWith("+"))
|
String username = identity.email.split("@")[0];
|
||||||
email = email.substring(0, at) + message.extra + email.substring(at);
|
if (at > 0 && !message.extra.equals(username)) {
|
||||||
else
|
if (message.extra.length() > 1 && message.extra.startsWith("+"))
|
||||||
email = message.extra + email.substring(at);
|
email = email.substring(0, at) + message.extra + email.substring(at);
|
||||||
if (!identity.sender_extra_name)
|
else
|
||||||
name = null;
|
email = message.extra + email.substring(at);
|
||||||
Log.i("extra=" + email);
|
if (!identity.sender_extra_name)
|
||||||
|
name = null;
|
||||||
|
Log.i("extra=" + email);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
imessage.setFrom(new InternetAddress(email, name, StandardCharsets.UTF_8.name()));
|
imessage.setFrom(new InternetAddress(email, name, StandardCharsets.UTF_8.name()));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue