aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-tl.el
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-03-22 16:42:48 +0100
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-03-22 16:42:48 +0100
commite1740a7386a4cef95fb06133a28144aa8160f21c (patch)
tree4c9d2cd70730bf118d0e2aaecc658d85974af37f /lisp/mastodon-tl.el
parentfc37e87072e268ee7c330b133ad796a7fd1887c5 (diff)
do-if-toot-strict, to prevent faves/boosts on user listings
Diffstat (limited to 'lisp/mastodon-tl.el')
-rw-r--r--lisp/mastodon-tl.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index db1e40e..bf0bc7e 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -1771,10 +1771,17 @@ ID is that of the post the context is currently displayed for."
"Execute BODY if we have a toot or user at point."
(declare (debug t))
`(if (and (not (mastodon-tl--profile-buffer-p))
- (not (mastodon-tl--property 'toot-json)))
+ (not (mastodon-tl--property 'toot-json))) ; includes user listings
(message "Looks like there's no toot or user at point?")
,@body))
+(defmacro mastodon-tl--do-if-toot-strict (&rest body)
+ "Execute BODY if we have a toot, and only a toot, at point."
+ (declare (debug t))
+ `(if (not (mastodon-tl--property 'toot-id :no-move))
+ (message "Looks like there's no toot at point?")
+ ,@body))
+
(defun mastodon-tl--follow-user (user-handle &optional notify langs)
"Query for USER-HANDLE from current status and follow that user.
If NOTIFY is \"true\", enable notifications when that user posts.