From: Eric Wong Date: Fri, 19 Aug 2022 09:07:44 +0000 (+0000) Subject: smsg: ->populate falls back to old {ds}/{ts} values X-Git-Tag: v1.9.0~8 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=f5aa8e80e77205830e4bbdf938fc2b25cd45865d;p=public-inbox.git 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. --- 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];