1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-27 10:17:18 +00:00

Print attachments file names in header

This commit is contained in:
M66B 2021-02-09 15:08:38 +01:00
parent cf84f733d9
commit c010734960

View file

@ -7420,6 +7420,20 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
header.appendChild(span);
}
for (EntityAttachment attachment : attachments)
if (attachment.isAttachment()) {
Element span = document.createElement("span");
Element strong = document.createElement("strong");
strong.text(context.getString(R.string.title_attachment));
span.appendChild(strong);
if (!TextUtils.isEmpty(attachment.name))
span.appendText(" " + attachment.name);
if (attachment.size != null)
span.appendText(" " + Helper.humanReadableByteCount(attachment.size));
span.appendElement("br");
header.appendChild(span);
}
if (!TextUtils.isEmpty(message.subject)) {
Element span = document.createElement("span");
span.appendText(message.subject);
@ -7437,25 +7451,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
header.appendElement("hr").appendElement("br");
document.body().prependChild(header);
boolean hasAttachments = false;
Element footer = document.createElement("p");
footer.appendElement("br").appendElement("hr");
for (EntityAttachment attachment : attachments)
if (attachment.isAttachment()) {
hasAttachments = true;
Element strong = document.createElement("strong");
strong.text(context.getString(R.string.title_attachment));
footer.appendChild(strong);
if (!TextUtils.isEmpty(attachment.name))
footer.appendText(" " + attachment.name);
if (attachment.size != null)
footer.appendText(" " + Helper.humanReadableByteCount(attachment.size));
footer.appendElement("br");
}
if (hasAttachments)
document.body().appendChild(footer);
}
return new String[]{message.subject, document.body().html()};