]> Sergey Matveev's repositories - public-inbox.git/commitdiff
searchview: set obfuscation inbox properly
authorEric Wong <e@yhbt.net>
Sun, 23 Feb 2020 22:47:15 +0000 (22:47 +0000)
committerEric Wong <e@yhbt.net>
Mon, 24 Feb 2020 18:29:54 +0000 (18:29 +0000)
We never lookup `$ctx->{-obfuscate}' anywhere, as the
correct key is `$ctx->{-obfs_ibx}' since some of the
address obfuscation stuff is inbox-specific.

Note: some of the obfuscation stuff still needs tests,
but it's low-priority at the moment since I don't think
it's a good feature after all.

lib/PublicInbox/SearchView.pm

index 9b67b045c16eb0af177bb5f833dc5239f7bd0507..0bd94774942da048f726fbd4e9a4f38fff665e13 100644 (file)
@@ -268,7 +268,8 @@ sub load_msgs {
 
 sub mset_thread {
        my ($ctx, $mset, $q) = @_;
-       my $msgs = $ctx->{-inbox}->search->retry_reopen(\&load_msgs, $mset);
+       my $ibx = $ctx->{-inbox};
+       my $msgs = $ibx->search->retry_reopen(\&load_msgs, $mset);
        my $r = $q->{r};
        my $rootset = PublicInbox::SearchThread::thread($msgs,
                $r ? \&sort_relevance : \&PublicInbox::View::sort_ds,
@@ -285,7 +286,7 @@ sub mset_thread {
        $ctx->{s_nr} = scalar(@$msgs).'+ results';
 
        # reduce hash lookups in skel_dump
-       $ctx->{-obfuscate} = $ctx->{-inbox}->{obfuscate};
+       $ctx->{-obfs_ibx} = $ibx->{obfuscate} ? $ibx : undef;
        PublicInbox::View::walk_thread($rootset, $ctx,
                \&PublicInbox::View::pre_thread);