From 956abe9ad5f13a0d1755262be412d6a54fda72e9 Mon Sep 17 00:00:00 2001 From: "Eric Wong (Contractor, The Linux Foundation)" Date: Mon, 26 Mar 2018 19:33:18 +0000 Subject: view: depend on SearchMsg for Message-ID Since we need to handle messages with multiple and duplicate Message-ID headers, our thread skeleton display must account for that. Since we have a "preferred" Message-ID in case of conflicts, use it as the UUID in an Atom feed so readers do not get confused by conflicts. --- lib/PublicInbox/SearchView.pm | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'lib/PublicInbox/SearchView.pm') diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm index 6e537b49..1a8fe7f7 100644 --- a/lib/PublicInbox/SearchView.pm +++ b/lib/PublicInbox/SearchView.pm @@ -248,15 +248,14 @@ sub mset_thread { *PublicInbox::View::pre_thread); @$msgs = reverse @$msgs if $r; - my $mime; sub { return unless $msgs; - while ($mime = pop @$msgs) { - $mime = $inbox->msg_by_smsg($mime) and last; + my $smsg; + while (my $m = pop @$msgs) { + $smsg = $inbox->smsg_mime($m) and last; } - if ($mime) { - $mime = PublicInbox::MIME->new($mime); - return PublicInbox::View::index_entry($mime, $ctx, + if ($smsg) { + return PublicInbox::View::index_entry($smsg, $ctx, scalar @$msgs); } $msgs = undef; @@ -290,8 +289,7 @@ sub adump { PublicInbox::WwwAtomStream->response($ctx, 200, sub { while (my $x = shift @items) { $x = load_doc_retry($srch, $x); - $x = $ibx->msg_by_smsg($x) and - return PublicInbox::MIME->new($x); + $x = $ibx->smsg_mime($x) and return $x; } return undef; }); -- cgit v1.2.3-24-ge0c7