branch: elpa/mastodon
commit 4b892cad51b4dacbc2a00426c90223b8fe97ac09
Author: marty hiatt <martianhia...@riseup.net>
Commit: marty hiatt <martianhia...@riseup.net>

    defcustom for hiding sensitive media
---
 lisp/mastodon-media.el | 7 ++++++-
 mastodon-index.org     | 2 ++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/lisp/mastodon-media.el b/lisp/mastodon-media.el
index ccc0893f8d..d14d28340f 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)
diff --git a/mastodon-index.org b/mastodon-index.org
index 90be3dff22..4637403013 100644
--- a/mastodon-index.org
+++ b/mastodon-index.org
@@ -137,6 +137,7 @@
 |                  | mastodon-tl--single-toot                          | View 
toot at point in separate buffer.                                         |
 |                  | mastodon-tl--some-followed-tags-timeline          | 
Prompt for some tags, and open a timeline for them.                            |
 | RET, T           | mastodon-tl--thread                               | Open 
thread buffer for toot at point or with ID.                               |
+|                  | mastodon-tl--toggle-sensitive-image               | 
Toggle dislay of sensitive image at point.                                     |
 |                  | mastodon-tl--toggle-spoiler-in-thread             | 
Toggler content warning for all posts in current thread.                       |
 | c                | mastodon-tl--toggle-spoiler-text-in-toot          | 
Toggle the visibility of the spoiler text in the current toot.                 |
 | C-S-b            | mastodon-tl--unblock-user                         | Query 
for USER-HANDLE from list of blocked users and unblock that user.        |
@@ -247,6 +248,7 @@
 | mastodon-instance-url                                        | Base URL for 
the fediverse instance you want to be active.                    |
 | mastodon-media--avatar-height                                | Height of the 
user avatar images (if shown).                                  |
 | mastodon-media--enable-image-caching                         | Whether 
images should be cached.                                              |
+| mastodon-media--hide-sensitive-media                         | Whether media 
marked as sensitive should be hidden.                           |
 | mastodon-media--preview-max-height                           | Max height of 
any media attachment preview to be shown in timelines.          |
 | mastodon-mode-hook                                           | Hook run when 
entering Mastodon mode.                                         |
 | mastodon-notifications--profile-note-in-foll-reqs            | If non-nil, 
show a user's profile note in follow request notifications.       |

Reply via email to