aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-08-19 09:35:44 +0200
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-08-19 09:35:44 +0200
commit51eb7c54e342b6bf2cb76fd93af5d5c2c184eea4 (patch)
tree694df0f9277b2f41365233384ff9de36d9fa3ffe
parent818dc1525fe2181e034b6fd020a34a40ce5a200e (diff)
format for bookmarked toots, help-echo for B/F/K format chars
-rw-r--r--lisp/mastodon-tl.el19
1 files changed, 15 insertions, 4 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index a59897c..be416f3 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -532,6 +532,7 @@ By default it is `mastodon-tl--byline-boosted'"
(parsed-time (date-to-time created-time))
(faved (equal 't (mastodon-tl--field 'favourited toot)))
(boosted (equal 't (mastodon-tl--field 'reblogged toot)))
+ (bookmarked (equal 't (mastodon-tl--field 'bookmarked toot)))
(visibility (mastodon-tl--field 'visibility toot)))
(concat
;; Boosted/favourited markers are not technically part of the byline, so
@@ -544,7 +545,9 @@ By default it is `mastodon-tl--byline-boosted'"
(concat (when boosted
(mastodon-tl--format-faved-or-boosted-byline "B"))
(when faved
- (mastodon-tl--format-faved-or-boosted-byline "F")))
+ (mastodon-tl--format-faved-or-boosted-byline "F"))
+ (when bookmarked
+ (mastodon-tl--format-faved-or-boosted-byline "K")))
(propertize
(concat
;; we propertize help-echo format faves for author name
@@ -575,9 +578,17 @@ By default it is `mastodon-tl--byline-boosted'"
(defun mastodon-tl--format-faved-or-boosted-byline (letter)
"Format the byline marker for a boosted or favourited status.
-LETTER is a string, either F or B."
- (format "(%s) "
- (propertize letter 'face 'mastodon-boost-fave-face)))
+LETTER is a string, F for favourited, B for boosted, or K for bookmarked."
+ (let ((help-string (cond ((equal letter "F")
+ "favourited")
+ ((equal letter "B")
+ "boosted")
+ ((equal letter "K")
+ "bookmarked"))))
+ (format "(%s) "
+ (propertize letter 'face 'mastodon-boost-fave-face
+ 'help-echo (format "You have %s this status."
+ help-string)))))
(defun mastodon-tl--render-text (string toot)
"Return a propertized text rendering the given HTML string STRING.