Simplification

pull/199/head
M66B 4 years ago
parent 12076cdffb
commit 340c2ab2ad

@ -222,12 +222,10 @@ public class MessageHelper {
String email = ((InternetAddress) message.from[0]).getAddress();
String name = ((InternetAddress) message.from[0]).getPersonal();
if (identity != null && identity.sender_extra &&
identity.email.contains("@") &&
email != null &&
email.contains("@") &&
message.extra != null &&
!message.extra.equals(identity.email.split("@")[0])) {
email != null && message.extra != null) {
int at = email.indexOf('@');
String username = identity.email.split("@")[0];
if (at > 0 && !message.extra.equals(username)) {
if (message.extra.length() > 1 && message.extra.startsWith("+"))
email = email.substring(0, at) + message.extra + email.substring(at);
else
@ -236,6 +234,7 @@ public class MessageHelper {
name = null;
Log.i("extra=" + email);
}
}
imessage.setFrom(new InternetAddress(email, name, StandardCharsets.UTF_8.name()));
}

Loading…
Cancel
Save