aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-toot.el
diff options
context:
space:
mode:
authorHolger Dürer <me@hdurer.net>2018-08-10 13:58:22 +0100
committerJohnson Denen <johnson.denen@gmail.com>2018-08-10 22:20:04 -0400
commitc5b228ec3cb8a7e7136688062a95ddd9391cfcd5 (patch)
treedff22250d2c30d52379b0ad605b08f6db7b73c52 /lisp/mastodon-toot.el
parent58afa3e24527c0dafeef669c285ac8ab11e3a42e (diff)
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.
Diffstat (limited to 'lisp/mastodon-toot.el')
-rw-r--r--lisp/mastodon-toot.el8
1 files changed, 6 insertions, 2 deletions
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