mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-04 06:20:26 +00:00
Added subject translation
This commit is contained in:
parent
44317fa0b9
commit
dfb43001de
1 changed files with 12 additions and 0 deletions
|
@ -7557,12 +7557,24 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
protected String onExecute(Context context, Bundle args) throws Throwable {
|
||||
long id = args.getLong("id");
|
||||
|
||||
DB db = DB.getInstance(context);
|
||||
EntityMessage message = db.message().getMessage(id);
|
||||
|
||||
File file = EntityMessage.getFile(context, id);
|
||||
String html = Helper.readText(file);
|
||||
Document d = HtmlHelper.sanitizeCompose(context, html, false);
|
||||
|
||||
d.select("blockquote").remove();
|
||||
|
||||
HtmlHelper.truncate(d, HtmlHelper.MAX_TRANSLATABLE_TEXT_SIZE);
|
||||
|
||||
SpannableStringBuilder ssb = HtmlHelper.fromDocument(context, d, null, null);
|
||||
|
||||
if (message != null && message.subject != null) {
|
||||
ssb.insert(0, "\n\n");
|
||||
ssb.insert(0, message.subject);
|
||||
}
|
||||
|
||||
return ssb.toString()
|
||||
.replace("\uFFFC", "") // Object replacement character
|
||||
.replaceAll("\n\\s+\n", "\n")
|
||||
|
|
Loading…
Reference in a new issue