Maximum size for reformatting

pull/172/head
M66B 5 years ago
parent 23bd903965
commit faa88fd3f6

@ -236,6 +236,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private static final ExecutorService executor =
Helper.getBackgroundExecutor(2, "differ");
private static final int LARGE_MESSAGE_SIZE = 250 * 1024;
// https://github.com/newhouse/url-tracking-stripper
private static final List<String> PARANOID_QUERY = Collections.unmodifiableList(Arrays.asList(
"utm_source",
@ -1606,6 +1608,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
return document.html();
} else {
if (body.length() > LARGE_MESSAGE_SIZE)
return HtmlHelper.fromHtml("<em>" + context.getString(R.string.title_too_large) + "</em>");
// Cleanup message
document = HtmlHelper.sanitize(context, body, show_images, true);

@ -670,6 +670,7 @@
<string name="title_no_format">The originally received message will be included</string>
<string name="title_no_image">Image could not be decoded</string>
<string name="title_no_search">Search on server is not available for this account</string>
<string name="title_too_large">Message too large to reformat, try to use the original message view via the full screen icon instead</string>
<string name="title_unused_inline">Unused inline images will be removed on send</string>
<string name="title_accross_remark">Messages moved across accounts will be downloaded again resulting in extra data usage</string>
<string name="title_raw_saved">Raw message saved</string>

Loading…
Cancel
Save