From c5b228ec3cb8a7e7136688062a95ddd9391cfcd5 Mon Sep 17 00:00:00 2001 From: Holger Dürer Date: Fri, 10 Aug 2018 13:58:22 +0100 Subject: Fix boosting and faving in the notifications buffer. Now that we calculate the base toot id, we can ensure that it is unset in notifications that do not represent a toot. --- lisp/mastodon-toot.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lisp/mastodon-toot.el') diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index c21e5b6..b760ac2 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -89,7 +89,9 @@ Remove MARKER if REMOVE is non-nil, otherwise add it." (defun mastodon-toot--toggle-boost () "Boost/unboost toot at `point'." (interactive) - (let* ((byline-region (mastodon-tl--find-property-range 'byline (point))) + (let* ((has-id (mastodon-tl--property 'base-toot-id)) + (byline-region (when has-id + (mastodon-tl--find-property-range 'byline (point)))) (id (when byline-region (mastodon-tl--as-string (mastodon-tl--property 'base-toot-id)))) (boosted (when byline-region @@ -113,7 +115,9 @@ Remove MARKER if REMOVE is non-nil, otherwise add it." (defun mastodon-toot--toggle-favourite () "Favourite/unfavourite toot at `point'." (interactive) - (let* ((byline-region (mastodon-tl--find-property-range 'byline (point))) + (let* ((has-id (mastodon-tl--property 'base-toot-id)) + (byline-region (when has-id + (mastodon-tl--find-property-range 'byline (point)))) (id (when byline-region (mastodon-tl--as-string (mastodon-tl--property 'base-toot-id)))) (faved (when byline-region -- cgit v1.2.3