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/SearchMsg.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/PublicInbox/SearchMsg.pm') diff --git a/lib/PublicInbox/SearchMsg.pm b/lib/PublicInbox/SearchMsg.pm index 93e6fd8b..a62a6490 100644 --- a/lib/PublicInbox/SearchMsg.pm +++ b/lib/PublicInbox/SearchMsg.pm @@ -31,13 +31,14 @@ sub get_val ($$) { sub load_from_data ($$) { my ($self) = $_[0]; # data = $_[1] - my ($subj, $from, $refs, $to, $cc, $blob) = split(/\n/, $_[1]); + my ($subj, $from, $refs, $to, $cc, $blob, $mid0) = split(/\n/, $_[1]); $self->{subject} = $subj; $self->{from} = $from; $self->{references} = $refs; $self->{to} = $to; $self->{cc} = $cc; $self->{blob} = $blob; + $self->{mid} = $mid0; } sub load_expand { @@ -120,11 +121,11 @@ sub ts { } sub to_doc_data { - my ($self, $blob) = @_; + my ($self, $oid, $mid0) = @_; my @rows = ($self->subject, $self->from, $self->references, $self->to, $self->cc); - push @rows, $blob if defined $blob; - join("\n", @rows); + $oid = '' unless defined $oid; + join("\n", @rows, $oid, $mid0); } sub references { -- cgit v1.2.3-24-ge0c7