mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-27 16:33:47 +00:00
Remove name on extra
This commit is contained in:
parent
bf87b4b385
commit
f32b70368f
1 changed files with 7 additions and 1 deletions
|
@ -157,9 +157,15 @@ public class MessageHelper {
|
||||||
if (message.from != null && message.from.length > 0) {
|
if (message.from != null && message.from.length > 0) {
|
||||||
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 (email != null && identity != null && identity.sender_extra && !TextUtils.isEmpty(message.extra)) {
|
if (identity != null && identity.sender_extra &&
|
||||||
|
identity.email.contains("@") &&
|
||||||
|
email != null &&
|
||||||
|
email.contains("@") &&
|
||||||
|
message.extra != null &&
|
||||||
|
!message.extra.equals(identity.email.split("@")[0])) {
|
||||||
int at = email.indexOf('@');
|
int at = email.indexOf('@');
|
||||||
email = message.extra + email.substring(at);
|
email = message.extra + email.substring(at);
|
||||||
|
name = null;
|
||||||
Log.i("extra=" + email);
|
Log.i("extra=" + email);
|
||||||
}
|
}
|
||||||
imessage.setFrom(new InternetAddress(email, name));
|
imessage.setFrom(new InternetAddress(email, name));
|
||||||
|
|
Loading…
Reference in a new issue