aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-media.el
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-05-10 15:55:57 +0200
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-05-11 09:55:18 +0200
commit6a6f7645c454c080046dc6409cc2583baef3bbab (patch)
tree13d578688983e15febdc0993dd387f8e05ab2374 /lisp/mastodon-media.el
parent9722f59b00fe76994d01ce980d619bb04b87b9ff (diff)
re-do vid overlay clean up
Diffstat (limited to 'lisp/mastodon-media.el')
-rw-r--r--lisp/mastodon-media.el31
1 files changed, 13 insertions, 18 deletions
diff --git a/lisp/mastodon-media.el b/lisp/mastodon-media.el
index 541e6de..12d51a1 100644
--- a/lisp/mastodon-media.el
+++ b/lisp/mastodon-media.el
@@ -174,12 +174,7 @@ with the image."
;; it; we already have set a default image when we
;; added the tag.
(put-text-property marker (+ marker region-length)
- 'display image)
- (when (not (equal "image"
- (get-text-property marker 'mastodon-media-type)))
- (let ((ov (make-overlay marker (+ marker region-length)
- (marker-buffer marker))))
- (overlay-put ov 'after-string " ▶"))))
+ 'display image))
;; We are done with the marker; release it:
(set-marker marker nil)))
(kill-buffer url-buffer)))))))
@@ -264,6 +259,7 @@ Replace them with the referenced image."
(let* ((start (car line-details))
(end (cadr line-details))
(media-type (cadr (cdr line-details)))
+ (type (get-text-property start 'mastodon-media-type))
(image-url (get-text-property start 'media-url)))
(if (not (mastodon-media--valid-link-p image-url))
;; mark it at least as not needing loading any more
@@ -272,26 +268,25 @@ Replace them with the referenced image."
(put-text-property start end 'media-state 'loading)
(mastodon-media--load-image-from-url
image-url media-type start (- end start))
- (mastodon-media--moving-image-overlay start end)))))))
+ (when (or (equal type "gifv")
+ (equal type "video"))
+ (mastodon-media--moving-image-overlay start end))))))))
;; (defvar-local mastodon-media--overlays nil
;; "Holds a list of overlays in the buffer.")
(defun mastodon-media--moving-image-overlay (start end)
"Add play symbol overlay to moving image media items."
- (let ((ov (make-overlay start end))
- (type (get-text-property start 'mastodon-media-type)))
- (when (or (equal type "gifv")
- (equal type "video"))
- (overlay-put
- ov
- 'after-string
- (propertize ""
- 'face
- '((:height 3.5 :inherit 'font-lock-comment-face)))))))
+ (let ((ov (make-overlay start end)))
+ (overlay-put
+ ov
+ 'after-string
+ (propertize ""
+ 'help-echo "Video"
+ 'face
+ '((:height 3.5 :inherit 'font-lock-comment-face))))))
;; (cl-pushnew ov mastodon-media--overlays)))
-(remove-overlays)
(defun mastodon-media--get-avatar-rendering (avatar-url)
"Return the string to be written that renders the avatar at AVATAR-URL."
;; We use just an empty space as the textual representation.