]> Sergey Matveev's repositories - public-inbox.git/commitdiff
view: Email::Address cache purge is optional
authorEric Wong <e@80x24.org>
Wed, 27 Aug 2014 19:34:03 +0000 (19:34 +0000)
committerEric Wong <e@80x24.org>
Thu, 28 Aug 2014 02:47:11 +0000 (02:47 +0000)
We will reuse the html_footer function in a nested index.

lib/PublicInbox/View.pm

index 8bc28cd17c5bc8912daf17de46e369b15a6e1318..ab607a0914b4b32b7936302e5c59ec817beaeff0 100644 (file)
@@ -30,7 +30,7 @@ sub msg_html {
        headers_to_html_header($mime, $full_pfx) .
                multipart_text_as_html($mime, $full_pfx) .
                '</pre><hr />' . PRE_WRAP .
-               html_footer($mime) . $footer .
+               html_footer($mime, 1) . $footer .
                '</pre></body></html>';
 }
 
@@ -204,7 +204,7 @@ sub headers_to_html_header {
 }
 
 sub html_footer {
-       my ($mime) = @_;
+       my ($mime, $purge) = @_;
        my %cc; # everyone else
        my $to; # this is the From address
 
@@ -219,7 +219,7 @@ sub html_footer {
                        $to ||= $dst;
                }
        }
-       Email::Address->purge_cache;
+       Email::Address->purge_cache if $purge;
 
        my $subj = $mime->header('Subject') || '';
        $subj = "Re: $subj" unless $subj =~ /\bRe:/;