about summary refs log tree commit homepage
path: root/lib/PublicInbox/SearchMsg.pm
diff options
context:
space:
mode:
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-03-06 04:15:38 +0000
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-03-06 04:51:41 +0000
commit35ac61764499c272d2760de2b2a432be412ecede (patch)
tree4902a8ce21a73c4e3f9b7724fcbadfd5e3038cf7 /lib/PublicInbox/SearchMsg.pm
parent8515f32bd403cae734b2fed534a6708758d7949a (diff)
downloadpublic-inbox-35ac61764499c272d2760de2b2a432be412ecede.tar.gz
The first Received: header is believable since it typically
hits the user's mail server and can be treated as relatively
trustworthy.  We still show the Date: in per-message (permalink)
views, which may expose users for having incorrect Date:
headers, but all the ISO YYYY-MM-DD dates we display will
match what we see.
Diffstat (limited to 'lib/PublicInbox/SearchMsg.pm')
-rw-r--r--lib/PublicInbox/SearchMsg.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/PublicInbox/SearchMsg.pm b/lib/PublicInbox/SearchMsg.pm
index a62a6490..23478a2a 100644
--- a/lib/PublicInbox/SearchMsg.pm
+++ b/lib/PublicInbox/SearchMsg.pm
@@ -7,9 +7,9 @@ package PublicInbox::SearchMsg;
 use strict;
 use warnings;
 use Search::Xapian;
-use Date::Parse qw/str2time/;
 use PublicInbox::MID qw/mid_clean mid_mime/;
 use PublicInbox::Address;
+use PublicInbox::MsgTime qw(msg_timestamp);
 
 sub new {
         my ($class, $mime) = @_;
@@ -117,7 +117,9 @@ sub from_name {
 
 sub ts {
         my ($self) = @_;
-        $self->{ts} ||= eval { str2time($self->{mime}->header('Date')) } || 0;
+        $self->{ts} ||= eval {
+                msg_timestamp($self->{mime}->header_obj);
+        } || 0;
 }
 
 sub to_doc_data {