]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Smsg.pm
update copyrights for 2021
[public-inbox.git] / lib / PublicInbox / Smsg.pm
index c0fd85fd6cfab47038c8d3faab47af602f34d9a4..571cbb6faca9417d804b1771b0bb94fdac5e6987 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2015-2020 all contributors <meta@public-inbox.org>
+# Copyright (C) 2015-2021 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 #
 # A small/skeleton/slim representation of a message.
@@ -69,7 +69,7 @@ sub psgi_cull ($) {
        $self;
 }
 
-# for Import and v1 non-SQLite WWW code paths
+# used for v2, Import and v1 non-SQLite WWW code paths
 sub populate {
        my ($self, $hdr, $sync) = @_;
        for my $f (qw(From To Cc Subject)) {
@@ -100,9 +100,7 @@ sub populate {
        $self->{-ts} = [ my @ts = msg_timestamp($hdr, $sync->{cotime}) ];
        $self->{ds} //= $ds[0]; # no zone
        $self->{ts} //= $ts[0];
-
-       # for v1 users w/o SQLite
-       $self->{mid} //= eval { mids($hdr)->[0] } // '';
+       $self->{mid} //= mids($hdr)->[0];
 }
 
 # no strftime, that is locale-dependent and not for RFC822
@@ -137,17 +135,4 @@ sub subject_normalized ($) {
        $subj;
 }
 
-sub xref3 {
-       my ($self, $doc) = @_;
-       my $end = $doc->termlist_end;
-       my $it = $doc->termlist_begin;
-       $it->skip_to('P');
-       my @ret;
-       for (; $it != $end; $it++) {
-               my $val = $it->get_termname;
-               $val =~ s/\AP// and push @ret, $val;
-       }
-       \@ret;
-}
-
 1;