mirror of https://github.com/M66B/FairEmail.git
Improved DSN decoding
This commit is contained in:
parent
57f6edcb41
commit
1530322087
|
@ -1920,21 +1920,26 @@ public class MessageHelper {
|
|||
} else if (h.isDSN()) {
|
||||
StringBuilder report = new StringBuilder();
|
||||
report.append("<hr><div style=\"font-family: monospace; font-size: small;\">");
|
||||
for (String line : result.split("\\r?\\n")) {
|
||||
if (line.length() > 0)
|
||||
if (Character.isWhitespace(line.charAt(0)))
|
||||
report.append(line).append("<br />");
|
||||
for (String line : result.split("\\r?\\n"))
|
||||
if (line.length() == 0)
|
||||
report.append("<br>");
|
||||
else if (Character.isWhitespace(line.charAt(0)))
|
||||
report.append(line).append("<br>");
|
||||
else {
|
||||
int colon = line.indexOf(':');
|
||||
if (colon < 0)
|
||||
report.append(line);
|
||||
else
|
||||
else {
|
||||
String name = line.substring(0, colon).trim();
|
||||
String value = line.substring(colon + 1).trim();
|
||||
value = decodeMime(value);
|
||||
report
|
||||
.append("<strong>")
|
||||
.append(line.substring(0, colon))
|
||||
.append(TextUtils.htmlEncode(name))
|
||||
.append("</strong>")
|
||||
.append(line.substring(colon))
|
||||
.append("<br />");
|
||||
.append(": ")
|
||||
.append(TextUtils.htmlEncode(value))
|
||||
.append("<br>");
|
||||
}
|
||||
}
|
||||
report.append("</div>");
|
||||
|
|
Loading…
Reference in New Issue