From f0f77a42fbd1b74fc0936dd1895812a4bc23d617 Mon Sep 17 00:00:00 2001 From: mousebot Date: Sat, 12 Mar 2022 09:03:02 +0100 Subject: 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. --- lisp/mastodon-tl.el | 17 +++++++++++++---- 1 file 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 -- cgit v1.2.3