aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-toot.el
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-01-28 09:36:11 +0100
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-01-28 09:39:33 +0100
commit3998bfa01b4a3998288061ab87d5c4f4c7ffdf3d (patch)
tree20a8bf94dd461456a11f32743f3d9c436bb5caa2 /lisp/mastodon-toot.el
parent4c276b5757dfef3e8e061811ec9d59ed36d6d8d9 (diff)
error msg on attempt to boost private toot. FIXES #383
Diffstat (limited to 'lisp/mastodon-toot.el')
-rw-r--r--lisp/mastodon-toot.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 0d4f9e2..cc3d506 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -342,7 +342,9 @@ TYPE is a symbol, either 'favourite or 'boost."
(msg (if boosted "unboosted" "boosted"))
(action-string (if boost-p "boost" "favourite"))
(remove (if boost-p (when boosted t) (when faved t)))
- (toot-type (alist-get 'type (mastodon-tl--property 'toot-json))))
+ (toot-type (alist-get 'type (mastodon-tl--property 'toot-json)))
+ (visibility (mastodon-tl--field 'visibility
+ (mastodon-tl--property 'toot-json))))
(if byline-region
(cond ;; actually there's nothing wrong with faving/boosting own toots!
;;((mastodon-toot--own-toot-p (mastodon-tl--property 'toot-json))
@@ -354,7 +356,10 @@ TYPE is a symbol, either 'favourite or 'boost."
(error "You can't %s boosts" action-string))
((and (equal "favourite" toot-type)
(not (string= (mastodon-tl--get-endpoint) "notifications")))
- (error "Your can't %s favourites" action-string))
+ (error "You can't %s favourites" action-string))
+ ((and (equal "private" visibility)
+ (equal type 'boost))
+ (error "You can't boost private toots."))
(t
(mastodon-toot--action
action