Added reply header to answer rule

This commit is contained in:
M66B
2020-08-07 10:40:24 +02:00
parent 18ef903971
commit a8a3289f74
3 changed files with 69 additions and 55 deletions

View File

@@ -3455,59 +3455,9 @@ public class FragmentCompose extends FragmentBase {
Element reply = document.createElement("div");
reply.attr("fairemail", "reference");
boolean language_detection = prefs.getBoolean("language_detection", false);
String language = (language_detection ? ref.language : null);
DateFormat DF;
if (language == null)
DF = Helper.getDateTimeInstance(context);
else
DF = SimpleDateFormat.getDateTimeInstance(
SimpleDateFormat.MEDIUM, SimpleDateFormat.MEDIUM,
new Locale(language));
// Build reply header
Element p = document.createElement("p");
boolean extended_reply = prefs.getBoolean("extended_reply", false);
if (extended_reply) {
if (ref.from != null && ref.from.length > 0) {
Element strong = document.createElement("strong");
strong.text(Helper.getString(context, language, R.string.title_from) + " ");
p.appendChild(strong);
p.appendText(MessageHelper.formatAddresses(ref.from));
p.appendElement("br");
}
if (ref.to != null && ref.to.length > 0) {
Element strong = document.createElement("strong");
strong.text(Helper.getString(context, language, R.string.title_to) + " ");
p.appendChild(strong);
p.appendText(MessageHelper.formatAddresses(ref.to));
p.appendElement("br");
}
if (ref.cc != null && ref.cc.length > 0) {
Element strong = document.createElement("strong");
strong.text(Helper.getString(context, language, R.string.title_cc) + " ");
p.appendChild(strong);
p.appendText(MessageHelper.formatAddresses(ref.cc));
p.appendElement("br");
}
{
Element strong = document.createElement("strong");
strong.text(Helper.getString(context, language, R.string.title_received) + " ");
p.appendChild(strong);
p.appendText(DF.format(ref.received));
p.appendElement("br");
}
{
Element strong = document.createElement("strong");
strong.text(Helper.getString(context, language, R.string.title_subject) + " ");
p.appendChild(strong);
p.appendText(ref.subject == null ? "" : ref.subject);
p.appendElement("br");
}
} else
p.text(DF.format(new Date(ref.received)) + " " + MessageHelper.formatAddresses(ref.from) + ":");
Element p = ref.getReplyHeader(context, document, extended_reply);
reply.appendChild(p);
Document d;