aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-11-22 16:54:42 +0100
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2022-11-22 16:54:42 +0100
commit5df90da80741714a7b5b49c054564dcc6c221c8b (patch)
tree3b1f724e1d51dd6ad6d77e254ef545a750b789aa
parentcbc27cfbcf2840eda619e425cc986c8198deea26 (diff)
copy-toot-url/text - handle fave/boost notifs
-rw-r--r--lisp/mastodon-toot.el14
1 files changed, 10 insertions, 4 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 18dba06..38f86b3 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -385,9 +385,12 @@ TYPE is a symbol, either 'favourite or 'boost."
(message (format "Nothing to %s here?!?" action)))))
(defun mastodon-toot--copy-toot-url ()
- "Copy URL of toot at point."
+ "Copy URL of toot at point.
+If the toot is a fave/boost notification, copy the URLof the
+base toot."
(interactive)
- (let* ((toot (mastodon-tl--property 'toot-json))
+ (let* ((toot (or (mastodon-tl--property 'base-toot)
+ (mastodon-tl--property 'toot-json)))
(url (if (mastodon-tl--field 'reblog toot)
(alist-get 'url (alist-get 'reblog toot))
(alist-get 'url toot))))
@@ -395,9 +398,12 @@ TYPE is a symbol, either 'favourite or 'boost."
(message "Toot URL copied to the clipboard.")))
(defun mastodon-toot--copy-toot-text ()
- "Copy text of toot at point."
+ "Copy text of toot at point.
+If the toot is a fave/boost notification, copy the text of the
+base toot."
(interactive)
- (let* ((toot (mastodon-tl--property 'toot-json)))
+ (let* ((toot (or (mastodon-tl--property 'base-toot)
+ (mastodon-tl--property 'toot-json))))
(kill-new (mastodon-tl--content toot))
(message "Toot content copied to the clipboard.")))