aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-04-25 20:33:32 +0200
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-05-08 08:08:33 +0200
commit92e49d913475fffc8c269cd15940db8b1dac6c87 (patch)
tree6d9ae3bee459ccdcb1ba3ce8cfd4d8fea74666cb /lisp
parentceaeb56cea5fa2d5214e57b5915e0d315b70e081 (diff)
let-alist --get-attachments for byline
Diffstat (limited to 'lisp')
-rw-r--r--lisp/mastodon-tl.el11
1 files changed, 4 insertions, 7 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index a992055..93ea20c 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -534,13 +534,10 @@ Used when point is at the start of a byline, i.e. where
The result is added as an attachments property to author-byline."
(let ((media-attachments (mastodon-tl--field 'media_attachments toot)))
(mapcar
- (lambda (attachement)
- (let ((remote-url
- (or (alist-get 'remote_url attachement)
- ;; fallback b/c notifications don't have remote_url
- (alist-get 'url attachement)))
- (type (alist-get 'type attachement)))
- `(:url ,remote-url :type ,type)))
+ (lambda (attachment)
+ (let-alist attachment
+ `(:url ,(or .remote_url .url) ; fallback for notifications
+ :type ,.type)))
media-attachments)))
(defun mastodon-tl--byline-boosted (toot)