mirror of https://github.com/M66B/FairEmail.git
Allow translating/transliterating 'from' email address
This commit is contained in:
parent
6e668fe374
commit
49d9286b56
|
@ -32,6 +32,7 @@ import android.os.Bundle;
|
|||
import android.text.Spannable;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextUtils;
|
||||
import android.text.method.ArrowKeyMovementMethod;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.text.style.ImageSpan;
|
||||
|
@ -62,6 +63,8 @@ import java.io.IOException;
|
|||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import javax.mail.Address;
|
||||
|
||||
public class FragmentDialogTranslate extends FragmentDialogBase {
|
||||
@NonNull
|
||||
@Override
|
||||
|
@ -360,11 +363,20 @@ public class FragmentDialogTranslate extends FragmentDialogBase {
|
|||
|
||||
SpannableStringBuilder ssb = HtmlHelper.fromDocument(context, d, null, null);
|
||||
|
||||
if (message != null && message.subject != null) {
|
||||
if (message != null) {
|
||||
if (!TextUtils.isEmpty(message.subject)) {
|
||||
ssb.insert(0, "\n\n");
|
||||
ssb.insert(0, message.subject);
|
||||
}
|
||||
|
||||
List<TupleIdentityEx> identities = db.identity().getComposableIdentities(message.account);
|
||||
Address[] from = (message.fromSelf(identities) ? message.to : message.from);
|
||||
if (from != null && from.length > 0) {
|
||||
ssb.insert(0, "\n\n");
|
||||
ssb.insert(0, MessageHelper.formatAddresses(from));
|
||||
}
|
||||
}
|
||||
|
||||
return ssb.toString()
|
||||
.replace("\uFFFC", "") // Object replacement character
|
||||
.replaceAll("\n\\s+\n", "\n")
|
||||
|
|
Loading…
Reference in New Issue