about summary refs log tree commit homepage
path: root/lib/PublicInbox/SearchMsg.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/SearchMsg.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/SearchMsg.pm')
-rw-r--r--lib/PublicInbox/SearchMsg.pm9
1 files changed, 5 insertions, 4 deletions
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 {