From 3082849c654fdee12ad97396b4e39be3c4888c1d Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 19 Dec 2019 05:18:00 +0000 Subject: searchthread: fix usage of user-supplied parameter Instead of only passing an Inbox object, we'll pass the $ctx reference as PublicInbox::SearchView::mset_thread did. So although mset_thread was wrong, we now make it's usage of SearchThread::thread correct and update other callers to favor the new style of passing the entire $ctx (with ->{-inbox}) instead of just the Inbox object. This makes the thread skeleton at the bottom of the search page to show subjects of messages, but unfortunately links to non-existent #anchors. The next commit will fix that. While we're at it, favor "\&foo" over "*foo" since the former makes the code reference (aka "function pointer) obvious so it won't be confused for other things named "foo" in that scope (e.g. $foo/@foo/%foo). --- lib/PublicInbox/View.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/PublicInbox/View.pm') diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 39b04174..33f71990 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -881,8 +881,7 @@ sub strict_loose_note ($) { sub thread_results { my ($ctx, $msgs) = @_; require PublicInbox::SearchThread; - my $ibx = $ctx->{-inbox}; - my $rootset = PublicInbox::SearchThread::thread($msgs, *sort_ds, $ibx); + my $rootset = PublicInbox::SearchThread::thread($msgs, \&sort_ds, $ctx); # FIXME: `tid' is broken on --reindex, so that needs to be fixed # and preserved in the future. This bug is hidden by `sid' matches -- cgit v1.2.3-24-ge0c7