From 8e253786fb256da75e67d8adc27a759dba23289a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 1 Jan 2024 01:07:48 +0000 Subject: over: re-sort Subject matches for WWW /T/ endpoint When retrieving loose (Subject) matches for a thread, we wanted the most recent matches in reverse chronological order. However, when displaying the /T/ endpoint generating the thread skeleton, we prefer ascending chronological order to match the flow of the conversation. Reported-by: Askar Safin Link: https://public-inbox.org/meta/CAPnZJGAqsh8ZhPaCAy5M2NZVNcWrr_Hr94t32VXiyiTXwD9jRQ@mail.gmail.com/ --- lib/PublicInbox/Over.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/PublicInbox/Over.pm b/lib/PublicInbox/Over.pm index 4eed4f46..3b7d49f5 100644 --- a/lib/PublicInbox/Over.pm +++ b/lib/PublicInbox/Over.pm @@ -200,6 +200,11 @@ ORDER BY $sort_col DESC # TODO separate strict and loose matches here once --reindex # is fixed to preserve `tid' properly push @$msgs, @$loose; + + # we wanted to retrieve the latest loose messages; but preserve + # chronological ordering for threading /$INBOX/$MSGID/[tT]/ + $sort_col eq 'ds' and + @$msgs = sort { $a->{ds} <=> $b->{ds} } @$msgs; } ($nr, $msgs); } -- cgit v1.2.3-24-ge0c7