]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Smsg.pm
No ext_urls
[public-inbox.git] / lib / PublicInbox / Smsg.pm
index 260ce6bb065e930adfd9030d50f5a06359e809ce..b132381b4ab2c3a93fd78b1fe042d1710a2c3fe8 100644 (file)
@@ -99,9 +99,6 @@ sub populate {
                # to protect git and NNTP clients
                $val =~ tr/\0\t\n/   /;
 
-               # rare: in case headers have wide chars (not RFC2047-encoded)
-               utf8::decode($val);
-
                # lower-case fields for read-only stuff
                $self->{lc($f)} = $val;
 
@@ -115,8 +112,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];