aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-tl.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/mastodon-tl.el')
-rw-r--r--lisp/mastodon-tl.el36
1 files changed, 19 insertions, 17 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index daa6626..27241f5 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -379,17 +379,10 @@ Used on initializing a timeline or thread."
(name (if (not (string-empty-p (alist-get 'display_name account)))
(alist-get 'display_name account)
(alist-get 'username account)))
- (profile-url (alist-get 'url account))
- (avatar-url (alist-get 'avatar account)))
- ;; TODO: Once we have a view for a user (e.g. their posts
- ;; timeline) make this a tab-stop and attach an action
+ (profile-url (alist-get 'url account)))
(concat
- (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-media--get-avatar-rendering avatar-url))
+ ;; avatar insertion moved up to `mastodon-tl--byline' in order to be
+ ;; outside of text prop 'byline t.
(propertize name
'face 'mastodon-display-name-face
;; enable playing of videos when point is on byline:
@@ -581,7 +574,9 @@ this just means displaying toot client."
(bookmark-str (if (fontp (char-displayable-p #10r128278))
"🔖"
"K"))
- (visibility (mastodon-tl--field 'visibility toot)))
+ (visibility (mastodon-tl--field 'visibility toot))
+ (account (alist-get 'account toot))
+ (avatar-url (alist-get 'avatar account)))
(concat
;; Boosted/favourited markers are not technically part of the byline, so
;; we don't propertize them with 'byline t', as per the rest. This
@@ -596,6 +591,14 @@ this just means displaying toot client."
(mastodon-tl--format-faved-or-boosted-byline "F"))
(when bookmarked
(mastodon-tl--format-faved-or-boosted-byline bookmark-str)))
+ ;; we remove avatars from the byline also, so that they also do not mess
+ ;; with `mastodon-tl--goto-next-toot':
+ (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-media--get-avatar-rendering avatar-url))
(propertize
(concat
;; we propertize help-echo format faves for author name
@@ -1328,13 +1331,12 @@ ID is that of the toot to view."
(defun mastodon-tl--thread (&optional id)
"Open thread buffer for toot at point or with ID."
+ ;; NB: this is called by `mastodon-url-lookup', which means it must work
+ ;; without `mastodon-tl--buffer-spec' being set!
+ ;; so avoid calls to `mastodon-tl--property' and friends
(interactive)
- (let* ((id
- (or id
- ;; avoid -tl--property here, we don't want to try next toot:
- ;; this requires that 'base-toot-id always be set:
- (get-text-property (point) 'base-toot-id)))
- (type (mastodon-tl--field 'type (mastodon-tl--property 'toot-json))))
+ (let* ((id (or id (get-text-property (point) 'base-toot-id)))
+ (type (mastodon-tl--field 'type (get-text-property (point) 'toot-json))))
(if (or (string= type "follow_request")
(string= type "follow")) ; no can thread these
(error "No thread")