From 8e52e5fdea416d6fda0b8d301144af0c043a5a76 Mon Sep 17 00:00:00 2001 From: "Eric Wong (Contractor, The Linux Foundation)" Date: Wed, 21 Mar 2018 01:52:58 +0000 Subject: use both Date: and Received: times We want to rely on Date: to sort messages within individual threads since it keeps messages from git-send-email(1) sorted. However, since developers occasionally have the clock set wrong on their machines, sort overall messages by the newest date in a Received: header so the landing page isn't forever polluted by messages from the future. This also gives us determinism for commit times in most cases, as we'll used the Received: timestamp there, as well. --- lib/PublicInbox/SearchIdx.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/SearchIdx.pm') diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm index 3d80b002..ef723a4b 100644 --- a/lib/PublicInbox/SearchIdx.pm +++ b/lib/PublicInbox/SearchIdx.pm @@ -134,7 +134,9 @@ sub add_values ($$) { my $lines = $values->[PublicInbox::Search::LINES]; add_val($doc, PublicInbox::Search::LINES, $lines); - my $yyyymmdd = strftime('%Y%m%d', gmtime($ts)); + my $ds = $values->[PublicInbox::Search::DS]; + add_val($doc, PublicInbox::Search::DS, $ds); + my $yyyymmdd = strftime('%Y%m%d', gmtime($ds)); add_val($doc, PublicInbox::Search::YYYYMMDD, $yyyymmdd); } @@ -298,7 +300,7 @@ sub add_message { } my $lines = $mime->body_raw =~ tr!\n!\n!; - my @values = ($smsg->ts, $num, $bytes, $lines); + my @values = ($smsg->ds, $num, $bytes, $lines, $smsg->ts); add_values($doc, \@values); my $tg = $self->term_generator; -- cgit v1.2.3-24-ge0c7