Conditionally more

pull/174/head
M66B 5 years ago
parent c71a263bbc
commit 10ae87d7cd

@ -1753,7 +1753,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
return document.html(); return document.html();
} else { } else {
// Cleanup message // Cleanup message
document = HtmlHelper.sanitize(context, body, show_images, true); document = HtmlHelper.sanitize(context, body, show_images, true, true);
// Collapse quotes // Collapse quotes
if (!show_quotes) { if (!show_quotes) {

@ -238,8 +238,12 @@ public class HtmlHelper {
} }
static Document sanitize(Context context, String html, boolean show_images, boolean autolink) { static Document sanitize(Context context, String html, boolean show_images, boolean autolink) {
return sanitize(context, html, show_images, autolink, false);
}
static Document sanitize(Context context, String html, boolean show_images, boolean autolink, boolean more) {
try { try {
return _sanitize(context, html, show_images, autolink); return _sanitize(context, html, show_images, autolink, more);
} catch (Throwable ex) { } catch (Throwable ex) {
// OutOfMemoryError // OutOfMemoryError
Log.e(ex); Log.e(ex);
@ -251,7 +255,7 @@ public class HtmlHelper {
} }
} }
private static Document _sanitize(Context context, String html, boolean show_images, boolean autolink) { private static Document _sanitize(Context context, String html, boolean show_images, boolean autolink, boolean more) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean text_color = prefs.getBoolean("text_color", true); boolean text_color = prefs.getBoolean("text_color", true);
boolean display_hidden = prefs.getBoolean("display_hidden", false); boolean display_hidden = prefs.getBoolean("display_hidden", false);
@ -339,6 +343,7 @@ public class HtmlHelper {
.appendElement("em") .appendElement("em")
.text(context.getString(R.string.title_too_large)); .text(context.getString(R.string.title_too_large));
if (more)
parsed.body() parsed.body()
.appendElement("p") .appendElement("p")
.appendElement("big") .appendElement("big")

Loading…
Cancel
Save