about summary refs log tree commit homepage
path: root/lib/PublicInbox/SearchView.pm
diff options
context:
space:
mode:
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-03-26 19:33:18 +0000
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-03-27 10:18:45 +0000
commit956abe9ad5f13a0d1755262be412d6a54fda72e9 (patch)
treecda2a73b8e234dbf6e3b1842e541054ab8a4d777 /lib/PublicInbox/SearchView.pm
parent50f7b8e95db516104cef237bb0a555a566ff150e (diff)
downloadpublic-inbox-956abe9ad5f13a0d1755262be412d6a54fda72e9.tar.gz
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.
Diffstat (limited to 'lib/PublicInbox/SearchView.pm')
-rw-r--r--lib/PublicInbox/SearchView.pm14
1 files changed, 6 insertions, 8 deletions
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;
         });