about summary refs log tree commit homepage
path: root/lib/PublicInbox/WwwAttach.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/WwwAttach.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/WwwAttach.pm')
-rw-r--r--lib/PublicInbox/WwwAttach.pm10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/PublicInbox/WwwAttach.pm b/lib/PublicInbox/WwwAttach.pm
index 09c66d02..0fe63e42 100644
--- a/lib/PublicInbox/WwwAttach.pm
+++ b/lib/PublicInbox/WwwAttach.pm
@@ -16,7 +16,7 @@ sub referer_match ($) {
         return 1 if $referer eq ''; # no referer is always OK for wget/curl
 
         # prevent deep-linking from other domains on some browsers (Firefox)
-        # n.b.: $ctx->{-inbox}->base_url($env) with INBOX_URL won't work
+        # n.b.: $ctx->{ibx}->base_url($env) with INBOX_URL won't work
         # with dillo, we can only match "$url_scheme://$HTTP_HOST/" without
         # path components
         my $base_url = $env->{'psgi.url_scheme'} . '://' .
@@ -88,15 +88,15 @@ sub get_attach ($$$) {
         $ctx->{idx} = $idx;
         bless $ctx, __PACKAGE__;
         my $eml;
-        if ($ctx->{smsg} = $ctx->{-inbox}->smsg_by_mid($ctx->{mid})) {
+        if ($ctx->{smsg} = $ctx->{ibx}->smsg_by_mid($ctx->{mid})) {
                 return sub { # public-inbox-httpd-only
                         $ctx->{wcb} = $_[0];
                         scan_attach($ctx);
                 } if $ctx->{env}->{'pi-httpd.async'};
                 # generic PSGI:
-                $eml = $ctx->{-inbox}->smsg_eml($ctx->{smsg});
-        } elsif (!$ctx->{-inbox}->over) {
-                if (my $bref = $ctx->{-inbox}->msg_by_mid($ctx->{mid})) {
+                $eml = $ctx->{ibx}->smsg_eml($ctx->{smsg});
+        } elsif (!$ctx->{ibx}->over) {
+                if (my $bref = $ctx->{ibx}->msg_by_mid($ctx->{mid})) {
                         $eml = PublicInbox::Eml->new($bref);
                 }
         }