diff options
author | marty hiatt <martianhiatus@riseup.net> | 2024-07-29 22:04:18 +0200 |
---|---|---|
committer | marty hiatt <martianhiatus@riseup.net> | 2024-07-29 22:10:16 +0200 |
commit | d7816ab59fdf64fc64adf3185052ee10931d7076 (patch) | |
tree | 33014603481a2490d16e97bed8cd291d8b09dfe1 | |
parent | d60d1d4c316a74397b6607b4d050d71b08ac007b (diff) |
add item-json prop to fave/boost strings, so (un)folding works
-rw-r--r-- | lisp/mastodon-toot.el | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index e884f97..666d1b0 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -319,11 +319,12 @@ NO-TOOT means we are not calling from a toot buffer." (with-current-buffer "*new toot*" (mastodon-toot--update-status-fields))))) -(defun mastodon-toot--action-success (marker byline-region remove) +(defun mastodon-toot--action-success (marker byline-region remove &optional json) "Insert/remove the text MARKER with `success' face in byline. BYLINE-REGION is a cons of start and end pos of the byline to be modified. -Remove MARKER if REMOVE is non-nil, otherwise add it." +Remove MARKER if REMOVE is non-nil, otherwise add it. +JSON is added to the string as its item-json." (let ((inhibit-read-only t) (bol (car byline-region)) (eol (cdr byline-region)) @@ -342,7 +343,8 @@ Remove MARKER if REMOVE is non-nil, otherwise add it." (format "(%s) " (propertize marker 'face 'success)) - 'cursor-face 'mastodon-cursor-highlight-face)))) + 'cursor-face 'mastodon-cursor-highlight-face + 'item-json json)))) ;; for (un)folding items (when at-byline-p ;; leave point after the marker: (unless remove @@ -422,7 +424,7 @@ TYPE is a symbol, either `favourite' or `boost.'" (mastodon-toot--action-success (if boost-p (mastodon-tl--symbol 'boost) (mastodon-tl--symbol 'favourite)) - byline-region remove)) + byline-region remove item-json)) (message (format "%s #%s" (if boost-p msg action) id))))))) (message (format "Nothing to %s here?!?" action-string)))))))) |