about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-08-19 09:07:44 +0000
committerEric Wong <e@80x24.org>2022-08-19 18:46:46 +0000
commitf5aa8e80e77205830e4bbdf938fc2b25cd45865d (patch)
treee0efab2e9c9bffddd8fe111df509e79d8f3bf66a
parent4ac15319847bc91ab2b7e8bb4b9f8955ba9fd55c (diff)
downloadpublic-inbox-f5aa8e80e77205830e4bbdf938fc2b25cd45865d.tar.gz
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.
-rw-r--r--lib/PublicInbox/Smsg.pm6
1 files 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];