diff options
author | mousebot <mousebot@riseup.net> | 2022-03-12 09:03:02 +0100 |
---|---|---|
committer | mousebot <mousebot@riseup.net> | 2022-03-12 09:12:01 +0100 |
commit | f0f77a42fbd1b74fc0936dd1895812a4bc23d617 (patch) | |
tree | fc47e97da150b4e3a44ec485718b350dea8f51bf /lisp | |
parent | 9bd49d3bbab945c625c935b9025dcd20c8e1e58d (diff) |
make timestamps for boost/fave notifs the time of orig toot
do not use the time stamp of the boosting/faving.
in other views, mastodon-tl--field already handles this by fetching from
'reblog if present, but in notifs, there's no reblog section, and instead
there's a status section. so we fetch from status if present, else fallback to
using --field.
this became necessary when we started attaching the boost/fave json to such
notifs, rather than the json of the boosed/faved toot.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/mastodon-tl.el | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 919bbbb..4833a3f 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -513,10 +513,19 @@ the byline that takes one variable. ACTION-BYLINE is a function for adding an action, such as boosting, favouriting and following to the byline. It also takes a single function. By default it is `mastodon-tl--byline-boosted'" - (let ((parsed-time (date-to-time (mastodon-tl--field 'created_at toot))) - (faved (equal 't (mastodon-tl--field 'favourited toot))) - (boosted (equal 't (mastodon-tl--field 'reblogged toot))) - (visibility (mastodon-tl--field 'visibility toot))) + (let* ((created-time + ;; bosts and faves in notifs view + ;; (makes timestamps be for the original toot + ;; not the boost/fave): + (or (mastodon-tl--field 'created_at + (mastodon-tl--field 'status toot)) + ;; all other toots, inc. boosts/faves in timelines: + ;; (mastodon-tl--field auto fetches from reblogs if needed): + (mastodon-tl--field 'created_at toot))) + (parsed-time (date-to-time created-time)) + (faved (equal 't (mastodon-tl--field 'favourited toot))) + (boosted (equal 't (mastodon-tl--field 'reblogged toot))) + (visibility (mastodon-tl--field 'visibility toot))) (concat ;; Boosted/favourited markers are not technically part of the byline, so ;; we don't propertize them with 'byline t', as per the rest. This |