aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus@riseup.net>2024-10-04 11:42:52 +0200
committermarty hiatt <martianhiatus@riseup.net>2024-10-04 11:42:52 +0200
commit71c68ba64c5be9d6bcf473d46aea2c0977b80048 (patch)
tree5f234adeea09d9e85af14125f30ba1ea9ea30c41 /lisp
parentf8345e6f1d9f4d5037a2aa00ba0c21f5682d25ad (diff)
add images in notifs customize
Diffstat (limited to 'lisp')
-rw-r--r--lisp/mastodon-notifications.el6
-rw-r--r--lisp/mastodon-tl.el8
2 files changed, 13 insertions, 1 deletions
diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el
index 1c2aad7..1a1c4ed 100644
--- a/lisp/mastodon-notifications.el
+++ b/lisp/mastodon-notifications.el
@@ -70,6 +70,10 @@ If unset, profile notes of any size will be displayed, which may
make them unweildy."
:type '(integer))
+(defcustom mastodon-notifications--images-in-notifs nil
+ "Whether to display attached images in notifications."
+ :type '(boolean))
+
(defvar mastodon-tl--buffer-spec)
(defvar mastodon-tl--display-media-p)
@@ -301,6 +305,8 @@ Call its function in that list on NOTE."
(when fun
(funcall fun note)
(when mastodon-tl--display-media-p
+ ;; images-in-notifs custom is handeld in
+ ;; `mastodon-tl--media-attachment', not here
(mastodon-media--inline-images start-pos (point))))))
(defun mastodon-notifications--timeline (json)
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 4058abc..f8088e6 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -96,6 +96,7 @@
(defvar mastodon-toot--visibility)
(defvar mastodon-toot-mode)
(defvar mastodon-active-user)
+(defvar mastodon-notifications--images-in-notifs)
(when (require 'mpv nil :no-error)
(declare-function mpv-start "mpv"))
@@ -1184,7 +1185,12 @@ SENSITIVE is a flag from the item's JSON data."
.description)
.description)
.preview_url)))
- (if mastodon-tl--display-media-p
+ (if (and mastodon-tl--display-media-p
+ ;; if in notifs, also check notifs images custom:
+ (if (or (mastodon-tl--buffer-type-eq 'notifications)
+ (mastodon-tl--buffer-type-eq 'mentions))
+ mastodon-notifications--images-in-notifs
+ t))
(mastodon-media--get-media-link-rendering ; placeholder: "[img]"
.preview_url (or .remote_url .url) ; for shr-browse-url
.type .description sensitive)