]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Smsg.pm
smsg: ->populate falls back to old {ds}/{ts} values
[public-inbox.git] / lib / PublicInbox / Smsg.pm
index 260ce6bb065e930adfd9030d50f5a06359e809ce..2026c7d900f65c057ba4a1d8a4bea6c0c9ca400e 100644 (file)
@@ -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];