Small improvement

This commit is contained in:
M66B 2021-12-24 20:27:17 +01:00
parent f8ea8b5d05
commit ece5780503
1 changed files with 21 additions and 4 deletions

View File

@ -2568,10 +2568,27 @@ public class MessageHelper {
} else if (h.isReport()) {
Report report = new Report(h.contentType.getBaseType(), result);
result = report.html;
if (!report.isDelivered() && report.diagnostic != null)
warnings.add(report.diagnostic);
if (!report.isDisplayed() && report.disposition != null)
warnings.add(report.disposition);
StringBuilder w = new StringBuilder();
if (!report.isDelivered()) {
if (report.diagnostic != null)
w.append(report.diagnostic);
if (report.action != null) {
if (w.length() == 0)
w.append(report.action);
else
w.append(" (").append(report.action).append(')');
}
}
if (!report.isDisplayed()) {
if (report.disposition != null)
w.append(report.disposition);
}
if (w.length() > 0)
warnings.add(w.toString());
} else
Log.w("Unexpected content type=" + h.contentType);