diff options
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/mastodon-media.el | 10 | ||||
-rw-r--r-- | lisp/mastodon-tl.el | 5 |
2 files changed, 10 insertions, 5 deletions
diff --git a/lisp/mastodon-media.el b/lisp/mastodon-media.el index 9441bdb..f79b1fa 100644 --- a/lisp/mastodon-media.el +++ b/lisp/mastodon-media.el @@ -307,12 +307,16 @@ Replace them with the referenced image." t image-options)) " "))) -(defun mastodon-media--get-media-link-rendering (media-url &optional full-remote-url type) +(defun mastodon-media--get-media-link-rendering (media-url &optional full-remote-url type caption) "Return the string to be written that renders the image at MEDIA-URL. FULL-REMOTE-URL is used for `shr-browse-image'. TYPE is the attachment's type field on the server." - (let ((help-echo - "RET/i: load full image (prefix: copy URL), +/-: zoom, r: rotate, o: save preview")) + (let* ((help-echo-base "RET/i: load full image (prefix: copy URL), +/-: zoom, r: rotate, o: save preview") + (help-echo (if caption + (concat help-echo-base + "\n\"" + caption "\"") + help-echo-base))) (concat (propertize "[img]" 'media-url media-url diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 7a346c1..6cd3ff0 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -817,10 +817,11 @@ message is a link which unhides/hides the main body." (or (alist-get 'remote_url media-attachement) ;; fallback b/c notifications don't have remote_url (alist-get 'url media-attachement))) - (type (alist-get 'type media-attachement))) + (type (alist-get 'type media-attachement)) + (caption (alist-get 'description media-attachement))) (if mastodon-tl--display-media-p (mastodon-media--get-media-link-rendering - preview-url remote-url type) ; 2nd arg for shr-browse-url + preview-url remote-url type caption) ; 2nd arg for shr-browse-url (concat "Media::" preview-url "\n")))) media-attachements ""))) (if (not (and mastodon-tl--display-media-p |