From 4b892cad51b4dacbc2a00426c90223b8fe97ac09 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Wed, 5 Jun 2024 20:12:45 +0200 Subject: defcustom for hiding sensitive media --- lisp/mastodon-media.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/mastodon-media.el b/lisp/mastodon-media.el index ccc0893..d14d283 100644 --- a/lisp/mastodon-media.el +++ b/lisp/mastodon-media.el @@ -60,6 +60,10 @@ "Whether images should be cached." :type 'boolean) +(defcustom mastodon-media--hide-sensitive-media t + "Whether media marked as sensitive should be hidden." + :type 'boolean) + (defvar mastodon-media--generic-avatar-data (base64-decode-string "iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAIAAAD/gAIDAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA @@ -314,7 +318,8 @@ MARKER, REGION-LENGTH and IMAGE are from `mastodon-media--process-image-response'. If the image is marked sensitive, the image is stored in image-data prop so it can be toggled." - (if (not (equal t (get-text-property marker 'sensitive))) + (if (or (not (equal t (get-text-property marker 'sensitive))) + (not mastodon-media--hide-sensitive-media)) ;; display image (put-text-property marker (+ marker region-length) 'display image) -- cgit v1.2.3