From 031dcde21cd8dab5494d9715ba50d6a539e3fb42 Mon Sep 17 00:00:00 2001 From: "Eric Wong (Contractor, The Linux Foundation)" Date: Sat, 3 Mar 2018 20:21:05 +0000 Subject: searchidx: store the primary MID in doc data for NNTP 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. --- lib/PublicInbox/SearchIdx.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox/SearchIdx.pm') 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'); } -- cgit v1.2.3-24-ge0c7