Added support for patch files

This commit is contained in:
M66B 2023-09-11 15:41:16 +02:00
parent 92215957fc
commit 80d5102364
1 changed files with 10 additions and 1 deletions

View File

@ -3508,6 +3508,11 @@ public class MessageHelper {
return "text/markdown".equalsIgnoreCase(contentType.getBaseType());
}
boolean isPatch() {
return "text/x-diff".equalsIgnoreCase(contentType.getBaseType()) ||
"text/x-patch".equalsIgnoreCase(contentType.getBaseType());
}
boolean isReport() {
String ct = contentType.getBaseType();
return (Report.isDeliveryStatus(ct) ||
@ -3924,6 +3929,8 @@ public class MessageHelper {
Log.e(ex);
result = HtmlHelper.formatPlainText(Log.formatThrowable(ex));
}
} else if (h.isPatch()) {
result = "<pre style=\"font-family: monospace; font-size:small;\">" + HtmlHelper.formatPlainText(result) + "</pre>";
} else if (h.isReport()) {
Report report = new Report(h.contentType.getBaseType(), result);
result = report.html;
@ -5049,7 +5056,9 @@ public class MessageHelper {
filename += ".html";
}
if ("text/markdown".equalsIgnoreCase(ct))
if ("text/markdown".equalsIgnoreCase(ct) ||
"text/x-diff".equalsIgnoreCase(ct) ||
"text/x-patch".equalsIgnoreCase(ct))
parts.extra.add(new PartHolder(part, contentType));
if (Report.isDeliveryStatus(ct) ||