about summary refs log tree commit homepage
path: root/lib/PublicInbox/SearchView.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2020-12-08 21:21:25 +0000
committerEric Wong <e@80x24.org>2020-12-09 21:13:31 +0000
commite3b57fe9f68e80fc85cff46ccec9246b670f1312 (patch)
tree826706be86815a62083ad953a2bbbb9f325cf670 /lib/PublicInbox/SearchView.pm
parent7e34a2145230eb97347ee8f1e63e79eb988a1946 (diff)
downloadpublic-inbox-e3b57fe9f68e80fc85cff46ccec9246b670f1312.tar.gz
{ibx} is shorter and is the most prevalent abbreviation
in indexing and IMAP code, and the `$ibx' local variable
is already prevalent throughout.

In general, the codebase favors removal of vowels in variable
and field names to denote non-references (because references are
"lighter" than non-references).

So update WWW and Filter users to use the same code since
it reduces confusion and may allow easier code sharing.
Diffstat (limited to 'lib/PublicInbox/SearchView.pm')
-rw-r--r--lib/PublicInbox/SearchView.pm14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm
index f3c96126..f568f31c 100644
--- a/lib/PublicInbox/SearchView.pm
+++ b/lib/PublicInbox/SearchView.pm
@@ -30,7 +30,7 @@ sub mbox_results {
 
 sub sres_top_html {
         my ($ctx) = @_;
-        my $srch = $ctx->{-inbox}->isrch or
+        my $srch = $ctx->{ibx}->isrch or
                 return PublicInbox::WWW::need($ctx, 'Search');
         my $q = PublicInbox::SearchQuery->new($ctx->{qp});
         my $x = $q->{x};
@@ -93,7 +93,7 @@ sub mset_summary {
         my $pad = length("$total");
         my $pfx = ' ' x $pad;
         my $res = \($ctx->{-html_tip});
-        my $ibx = $ctx->{-inbox};
+        my $ibx = $ctx->{ibx};
         my $obfs_ibx = $ibx->{obfuscate} ? $ibx : undef;
         my @nums = @{$ibx->isrch->mset_to_artnums($mset)};
         my %num2msg = map { $_->{num} => $_ } @{$ibx->over->get_all(@nums)};
@@ -156,7 +156,7 @@ sub path2inc ($) {
 
 sub err_txt {
         my ($ctx, $err) = @_;
-        my $u = $ctx->{-inbox}->base_url($ctx->{env}) . '_/text/help/';
+        my $u = $ctx->{ibx}->base_url($ctx->{env}) . '_/text/help/';
         $err =~ s/^\s*Exception:\s*//; # bad word to show users :P
         $err =~ s!(\S+)!path2inc($1)!sge;
         $err = ascii_html($err);
@@ -201,7 +201,7 @@ sub search_nav_top {
         }
         my $A = $q->qs_html(x => 'A', r => undef);
         $rv .= qq{|<a\nhref="?$A">Atom feed</a>]};
-        if ($ctx->{-inbox}->isrch->has_threadid) {
+        if ($ctx->{ibx}->isrch->has_threadid) {
                 $rv .= qq{\n\t\t\tdownload mbox.gz: } .
                         # we set name=z w/o using it since it seems required for
                         # lynx (but works fine for w3m).
@@ -286,7 +286,7 @@ sub get_pct ($) {
 
 sub mset_thread {
         my ($ctx, $mset, $q) = @_;
-        my $ibx = $ctx->{-inbox};
+        my $ibx = $ctx->{ibx};
         my @pct = map { get_pct($_) } $mset->items;
         my $msgs = $ibx->isrch->mset_to_smsg($ibx, $mset);
         my $i = 0;
@@ -353,7 +353,7 @@ sub ctx_prepare {
 
 sub adump {
         my ($cb, $mset, $q, $ctx) = @_;
-        $ctx->{ids} = $ctx->{-inbox}->isrch->mset_to_artnums($mset);
+        $ctx->{ids} = $ctx->{ibx}->isrch->mset_to_artnums($mset);
         $ctx->{search_query} = $q; # used by WwwAtomStream::atom_header
         PublicInbox::WwwAtomStream->response($ctx, 200, \&adump_i);
 }
@@ -362,7 +362,7 @@ sub adump {
 sub adump_i {
         my ($ctx) = @_;
         while (my $num = shift @{$ctx->{ids}}) {
-                my $smsg = eval { $ctx->{-inbox}->over->get_art($num) } or next;
+                my $smsg = eval { $ctx->{ibx}->over->get_art($num) } or next;
                 return $smsg;
         }
 }