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.Spannable;
|
||||||
import android.text.SpannableStringBuilder;
|
import android.text.SpannableStringBuilder;
|
||||||
import android.text.Spanned;
|
import android.text.Spanned;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.text.method.ArrowKeyMovementMethod;
|
import android.text.method.ArrowKeyMovementMethod;
|
||||||
import android.text.style.ForegroundColorSpan;
|
import android.text.style.ForegroundColorSpan;
|
||||||
import android.text.style.ImageSpan;
|
import android.text.style.ImageSpan;
|
||||||
|
@ -62,6 +63,8 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
|
import javax.mail.Address;
|
||||||
|
|
||||||
public class FragmentDialogTranslate extends FragmentDialogBase {
|
public class FragmentDialogTranslate extends FragmentDialogBase {
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
|
@ -360,9 +363,18 @@ public class FragmentDialogTranslate extends FragmentDialogBase {
|
||||||
|
|
||||||
SpannableStringBuilder ssb = HtmlHelper.fromDocument(context, d, null, null);
|
SpannableStringBuilder ssb = HtmlHelper.fromDocument(context, d, null, null);
|
||||||
|
|
||||||
if (message != null && message.subject != null) {
|
if (message != null) {
|
||||||
ssb.insert(0, "\n\n");
|
if (!TextUtils.isEmpty(message.subject)) {
|
||||||
ssb.insert(0, 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()
|
return ssb.toString()
|
||||||
|
|
Loading…
Reference in New Issue