Resend original

pull/209/head
M66B 3 years ago
parent 7a586a01ea
commit b64c4c6d2a

@ -928,15 +928,20 @@ public class MessageHelper {
// Build html body // Build html body
Document document = JsoupEx.parse(message.getFile(context)); Document document = JsoupEx.parse(message.getFile(context));
boolean resend = false;
if (message.headers != null && Boolean.TRUE.equals(message.resend)) { if (message.headers != null && Boolean.TRUE.equals(message.resend)) {
Element body = document.body(); Element body = document.body();
if (body.children().size() == 1) { if (body.children().size() == 1) {
// Restore original body // Restore original body
Element ref = body.children().get(0); Element ref = body.children().get(0);
if ("reference".equals(ref.attr("fairemail"))) {
body.replaceWith(ref.tagName("body").removeAttr("fairemail")); body.replaceWith(ref.tagName("body").removeAttr("fairemail"));
resend = true;
}
} }
} }
if (!resend) {
// https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang // https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang
if (message.language != null) if (message.language != null)
document.body().attr("lang", message.language); document.body().attr("lang", message.language);
@ -1028,6 +1033,7 @@ public class MessageHelper {
db.endTransaction(); db.endTransaction();
} }
} }
}
// multipart/mixed // multipart/mixed
// multipart/related // multipart/related

Loading…
Cancel
Save