aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-tl.el
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus@riseup.net>2024-08-08 11:05:05 +0200
committermarty hiatt <martianhiatus@riseup.net>2024-08-08 11:05:05 +0200
commit881ee6ab4133e63c4debc1b6e716d5e4bdb446aa (patch)
tree3551b49a1185f755ff410525d733725e37d2eb23 /lisp/mastodon-tl.el
parent21090d643515ad076c9900d601a1a901f464ccc9 (diff)
factor out image-trans-check.
Diffstat (limited to 'lisp/mastodon-tl.el')
-rw-r--r--lisp/mastodon-tl.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 80c1e42..0c9670b 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -591,9 +591,7 @@ When DOMAIN, force inclusion of user's domain in their handle."
(when (and avatar ; used by `mastodon-profile--format-user'
mastodon-tl--show-avatars
mastodon-tl--display-media-p
- (if (version< emacs-version "27.1")
- (image-type-available-p 'imagemagick)
- (image-transforms-p)))
+ (mastodon-tl--image-trans-check))
(mastodon-media--get-avatar-rendering .account.avatar))
;; username:
(propertize (if (not (string-empty-p .account.display_name))
@@ -696,6 +694,12 @@ LETTER is a string, F for favourited, B for boosted, or K for bookmarked."
'help-echo (format "You have %s this status."
help-string)))))
+(defun mastodon-tl--image-trans-check ()
+ "Call `image-transforms-p', or `image-type-available-p' 'imagemagick."
+ (if (version< emacs-version "27.1")
+ (image-type-available-p 'imagemagick)
+ (image-transforms-p)))
+
(defun mastodon-tl--byline (toot author-byline action-byline
&optional detailed-p domain base-toot)
"Generate byline for TOOT.
@@ -748,9 +752,7 @@ When DOMAIN, force inclusion of user's domain in their handle."
;; with `mastodon-tl--goto-next-item':
(when (and mastodon-tl--show-avatars
mastodon-tl--display-media-p
- (if (version< emacs-version "27.1")
- (image-type-available-p 'imagemagick)
- (image-transforms-p)))
+ (mastodon-tl--image-trans-check))
(mastodon-media--get-avatar-rendering avatar-url))
(propertize
(concat