about summary refs log tree commit homepage
path: root/lib/PublicInbox/SearchIdx.pm
diff options
context:
space:
mode:
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-03-03 20:21:05 +0000
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-03-03 20:24:43 +0000
commit031dcde21cd8dab5494d9715ba50d6a539e3fb42 (patch)
tree172df048191ee4cb07388f8d0b2a1e7246552667 /lib/PublicInbox/SearchIdx.pm
parentb212aee7e13c460b73a3632458ae96c39d9eac97 (diff)
downloadpublic-inbox-031dcde21cd8dab5494d9715ba50d6a539e3fb42.tar.gz
We can't rely on header order for Message-ID after all
since we fall back to existing MIDs if they exist and
are unseen.  This lets us use SearchMsg->mid to get the
MID we associated with the NNTP article number to ensure
all NNTP article lookups roundtrip correctly.
Diffstat (limited to 'lib/PublicInbox/SearchIdx.pm')
-rw-r--r--lib/PublicInbox/SearchIdx.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm
index a70e1ebf..71469a95 100644
--- a/lib/PublicInbox/SearchIdx.pm
+++ b/lib/PublicInbox/SearchIdx.pm
@@ -302,7 +302,8 @@ sub index_body ($$$) {
 }
 
 sub add_message {
-        my ($self, $mime, $bytes, $num, $blob) = @_; # mime = Email::MIME object
+        # mime = Email::MIME object
+        my ($self, $mime, $bytes, $num, $oid, $mid0) = @_;
         my $doc_id;
         my $mids = mids($mime->header_obj);
         my $skel = $self->{skeleton};
@@ -370,7 +371,8 @@ sub add_message {
 
                 # populates smsg->references for smsg->to_doc_data
                 my $refs = parse_references($smsg);
-                my $data = $smsg->to_doc_data($blob);
+                $mid0 = $mids->[0] unless defined $mid0;
+                my $data = $smsg->to_doc_data($oid, $mid0);
                 foreach my $mid (@$mids) {
                         $tg->index_text($mid, 1, 'XM');
                 }