diff options
author | Eric Wong (Contractor, The Linux Foundation) <e@80x24.org> | 2018-03-29 09:57:52 +0000 |
---|---|---|
committer | Eric Wong (Contractor, The Linux Foundation) <e@80x24.org> | 2018-03-29 10:00:04 +0000 |
commit | 11707dae97d1f4638157cfee298464b2f2deeed4 (patch) | |
tree | a25db85d1ab0e5e4daeb099140d31f1c07fd0c5c /lib/PublicInbox/View.pm | |
parent | 821ed7c40b7b50ceb1c942af5e14d168995d514e (diff) | |
download | public-inbox-11707dae97d1f4638157cfee298464b2f2deeed4.tar.gz |
Too many similar functions doing the same basic thing was redundant and misleading, especially since Message-ID is no longer treated as a truly unique identifier. For displaying threads in the HTML, this makes it clear that we favor the primary Message-ID mapped to an NNTP article number if a message cannot be found.
Diffstat (limited to 'lib/PublicInbox/View.pm')
-rw-r--r-- | lib/PublicInbox/View.pm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index aad860e9..f5b278c2 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -430,7 +430,7 @@ sub thread_html { $ctx->{mapping} = {}; $ctx->{s_nr} = "$nr+ messages in thread"; - my $rootset = thread_results($msgs, $srch); + my $rootset = thread_results($ctx, $msgs); # reduce hash lookups in pre_thread->skel_dump my $inbox = $ctx->{-inbox}; @@ -686,7 +686,7 @@ sub thread_skel { # reduce hash lookups in skel_dump my $ibx = $ctx->{-inbox}; $ctx->{-obfs_ibx} = $ibx->{obfuscate} ? $ibx : undef; - walk_thread(thread_results($sres, $srch), $ctx, *skel_dump); + walk_thread(thread_results($ctx, $sres), $ctx, *skel_dump); $ctx->{parent_msg} = $parent; } @@ -809,9 +809,9 @@ sub load_results { } sub thread_results { - my ($msgs, $srch) = @_; + my ($ctx, $msgs) = @_; require PublicInbox::SearchThread; - PublicInbox::SearchThread::thread($msgs, *sort_ds, $srch); + PublicInbox::SearchThread::thread($msgs, *sort_ds, $ctx->{-inbox}); } sub missing_thread { @@ -952,7 +952,7 @@ sub acc_topic { my ($ctx, $level, $node) = @_; my $srch = $ctx->{srch}; my $mid = $node->{id}; - my $x = $node->{smsg} || $srch->lookup_mail($mid); + my $x = $node->{smsg} || $ctx->{-inbox}->smsg_by_mid($mid); my ($subj, $ds); my $topic; if ($x) { @@ -1078,7 +1078,7 @@ sub index_topics { my $nr = scalar @{$sres->{msgs}}; if ($nr) { $sres = load_results($srch, $sres); - walk_thread(thread_results($sres, $srch), $ctx, *acc_topic); + walk_thread(thread_results($ctx, $sres), $ctx, *acc_topic); } $ctx->{-next_o} = $off+ $nr; $ctx->{-cur_o} = $off; |