From 3998bfa01b4a3998288061ab87d5c4f4c7ffdf3d Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sat, 28 Jan 2023 09:36:11 +0100 Subject: error msg on attempt to boost private toot. FIXES #383 --- lisp/mastodon-toot.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lisp') 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 -- cgit v1.2.3