|
|
|
@ -1481,26 +1481,8 @@ public class MessageHelper {
|
|
|
|
|
warnings.add(context.getString(R.string.title_no_charset, charset));
|
|
|
|
|
|
|
|
|
|
if (part.isMimeType("text/plain")) {
|
|
|
|
|
// https://tools.ietf.org/html/rfc3676
|
|
|
|
|
if ("flowed".equalsIgnoreCase(ct.getParameter("format"))) {
|
|
|
|
|
boolean continuation = false;
|
|
|
|
|
StringBuilder flowed = new StringBuilder();
|
|
|
|
|
for (String line : result.split("\\r?\\n")) {
|
|
|
|
|
if (continuation)
|
|
|
|
|
while (line.startsWith(">")) {
|
|
|
|
|
line = line.substring(1);
|
|
|
|
|
if (line.startsWith(" "))
|
|
|
|
|
line = line.substring(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
continuation = (line.endsWith(" ") && !"-- ".equals(line));
|
|
|
|
|
|
|
|
|
|
flowed.append(line);
|
|
|
|
|
if (!continuation)
|
|
|
|
|
flowed.append("\r\n");
|
|
|
|
|
}
|
|
|
|
|
result = flowed.toString();
|
|
|
|
|
}
|
|
|
|
|
if ("flowed".equalsIgnoreCase(ct.getParameter("format")))
|
|
|
|
|
result = HtmlHelper.flow(result);
|
|
|
|
|
result = "<div>" + HtmlHelper.formatPre(result) + "</div>";
|
|
|
|
|
} else if (part.isMimeType("text/html")) {
|
|
|
|
|
if (TextUtils.isEmpty(charset)) {
|
|
|
|
|