From f5aa8e80e77205830e4bbdf938fc2b25cd45865d Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 19 Aug 2022 09:07:44 +0000 Subject: [PATCH] smsg: ->populate falls back to old {ds}/{ts} values This will be useful for re-indexing external messages which were over-indexed in lei/store. --- lib/PublicInbox/Smsg.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/Smsg.pm b/lib/PublicInbox/Smsg.pm index 260ce6bb..2026c7d9 100644 --- a/lib/PublicInbox/Smsg.pm +++ b/lib/PublicInbox/Smsg.pm @@ -115,8 +115,10 @@ sub populate { $self->{$f} = $val if $val ne ''; } $sync //= {}; - $self->{-ds} = [ my @ds = msg_datestamp($hdr, $sync->{autime}) ]; - $self->{-ts} = [ my @ts = msg_timestamp($hdr, $sync->{cotime}) ]; + my @ds = msg_datestamp($hdr, $sync->{autime} // $self->{ds}); + my @ts = msg_timestamp($hdr, $sync->{cotime} // $self->{ts}); + $self->{-ds} = \@ds; + $self->{-ts} = \@ts; $self->{ds} //= $ds[0]; # no zone $self->{ts} //= $ts[0]; $self->{mid} //= mids($hdr)->[0]; -- 2.48.1