aboutsummaryrefslogtreecommitdiff
path: root/lisp
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
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')
-rw-r--r--lisp/mastodon-notifications.el10
-rw-r--r--lisp/mastodon-toot.el8
2 files changed, 12 insertions, 6 deletions
diff --git a/lisp/mastodon-notifications.el b/lisp/mastodon-notifications.el
index 1ec039a..e93048d 100644
--- a/lisp/mastodon-notifications.el
+++ b/lisp/mastodon-notifications.el
@@ -67,7 +67,7 @@
"Format for a `mention' NOTE."
(let ((status (mastodon-tl--field 'status note)))
(mastodon-tl--insert-status
- note
+ status
(mastodon-tl--clean-tabs-and-nl
(if (mastodon-tl--has-spoiler status)
(mastodon-tl--spoiler status)
@@ -80,7 +80,9 @@
(defun mastodon-notifications--follow (note)
"Format for a `follow' NOTE."
(mastodon-tl--insert-status
- note
+ ;; Using reblog with an empty id will mark this as something
+ ;; non-boostable/non-favable.
+ (cons '(reblog (id . nil)) note)
(propertize "Congratulations, you have a new follower!"
'face 'default)
'mastodon-tl--byline-author
@@ -92,7 +94,7 @@
"Format for a `favourite' NOTE."
(let ((status (mastodon-tl--field 'status note)))
(mastodon-tl--insert-status
- note
+ status
(mastodon-tl--clean-tabs-and-nl
(if (mastodon-tl--has-spoiler status)
(mastodon-tl--spoiler status)
@@ -108,7 +110,7 @@
"Format for a `boost' NOTE."
(let ((status (mastodon-tl--field 'status note)))
(mastodon-tl--insert-status
- note
+ status
(mastodon-tl--clean-tabs-and-nl
(if (mastodon-tl--has-spoiler status)
(mastodon-tl--spoiler status)
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