diff options
author | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2022-11-12 15:38:21 +0100 |
---|---|---|
committer | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2022-11-12 15:38:21 +0100 |
commit | 79158bd0fd0c67aab90f8ae52d4f90b4b167be22 (patch) | |
tree | 8db82caa9f44dbc18c326b092fd1a3f42f1bbd2f /lisp/mastodon-toot.el | |
parent | ac16395a753aeb9d2fd94ef22ee531227214b3a9 (diff) |
wholly remove parent-toot; use base-toot/-id only
the confusion came from the three different types of statuses we often
encounter:
- toot
- boost/fave
- notification (of boost/fave/mention)
in notifications, we can't just use -tl--toot-id. it will return the notif's
id, not the base toot's.
so we do still fetch base-toot JSON (formerly 'parent-toot prop), and get
base-toot-id from there, else from toot JSON.
Diffstat (limited to 'lisp/mastodon-toot.el')
-rw-r--r-- | lisp/mastodon-toot.el | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index e203cda..65649b8 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -816,16 +816,15 @@ Customize `mastodon-toot-display-orig-in-reply-buffer' to display text of the toot being replied to in the compose buffer." (interactive) (let* ((toot (mastodon-tl--property 'toot-json)) - ;; NB: we cannot use mastodon-tl--property for 'parent-toot + ;; NB: we cannot use mastodon-tl--property for 'base-toot ;; because if it doesn't have one, it is fetched from next toot! ;; we also cannot use --field because we need to get a different property first - (parent (get-text-property (point) 'parent-toot)) ; for new notifs handling - (id (mastodon-tl--as-string - (mastodon-tl--field 'id (or parent toot)))) + (base-toot (get-text-property (point) 'base-toot)) ; for new notifs handling + (id (mastodon-tl--as-string (mastodon-tl--field 'id (or base-toot toot)))) (account (mastodon-tl--field 'account toot)) (user (alist-get 'acct account)) - (mentions (mastodon-toot--mentions (or parent toot))) - (boosted (mastodon-tl--field 'reblog (or parent toot))) + (mentions (mastodon-toot--mentions (or base-toot toot))) + (boosted (mastodon-tl--field 'reblog (or base-toot toot))) (booster (when boosted (alist-get 'acct (alist-get 'account toot))))) @@ -853,7 +852,7 @@ text of the toot being replied to in the compose buffer." ;; user in mentions already: mentions))) id - (or parent toot)))) + (or base-toot toot)))) (defun mastodon-toot--toggle-warning () "Toggle `mastodon-toot--content-warning'." |