about summary refs log tree commit homepage
path: root/lib/PublicInbox/View.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-09-10 08:17:05 +0000
committerEric Wong <e@80x24.org>2022-09-10 19:50:35 +0000
commit109711976cb9c5e0b9a465b0b6ffcb509434f688 (patch)
tree03baf710a56f44bd3ee93384de1e74435a8538c6 /lib/PublicInbox/View.pm
parent62bd66a3e385251c127a055005c88d20f540c867 (diff)
downloadpublic-inbox-109711976cb9c5e0b9a465b0b6ffcb509434f688.tar.gz
It seems like a pointless wrapper function that's not saving us
a whole lot.  Drop some direct {obuf} manipulation while we're
at it.
Diffstat (limited to 'lib/PublicInbox/View.pm')
-rw-r--r--lib/PublicInbox/View.pm15
1 files changed, 4 insertions, 11 deletions
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 37b484ae..0b67d92f 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -39,8 +39,8 @@ sub msg_page_i {
                 $ctx->{mhref} = ($ctx->{nr} || $ctx->{smsg}) ?
                                 "../${\mid_href($smsg->{mid})}/" : '';
                 if (_msg_page_prepare_obuf($eml, $ctx)) {
-                        multipart_text_as_html($eml, $ctx);
-                        ${$ctx->{obuf}} .= '</pre><hr>';
+                        $eml->each_part(\&add_text_body, $ctx, 1);
+                        $ctx->zmore('</pre><hr>');
                 }
                 html_footer($ctx, $ctx->{first_hdr}) if !$ctx->{smsg};
                 delete($ctx->{obuf}) // \'';
@@ -57,8 +57,8 @@ sub no_over_html ($) {
         $ctx->{mhref} = '';
         PublicInbox::WwwStream::init($ctx);
         if (_msg_page_prepare_obuf($eml, $ctx)) { # sets {-title_html}
-                multipart_text_as_html($eml, $ctx);
-                ${$ctx->{obuf}} .= '</pre><hr>';
+                $eml->each_part(\&add_text_body, $ctx, 1);
+                $ctx->zmore('</pre><hr>');
         }
         html_footer($ctx, $eml);
         $ctx->html_done;
@@ -506,13 +506,6 @@ sub thread_html_i { # PublicInbox::WwwStream::getline callback
         }
 }
 
-sub multipart_text_as_html {
-        # ($mime, $ctx) = @_; # each_part may do "$_[0] = undef"
-
-        # scan through all parts, looking for displayable text
-        $_[0]->each_part(\&add_text_body, $_[1], 1);
-}
-
 sub submsg_hdr ($$) {
         my ($ctx, $eml) = @_;
         my $obfs_ibx = $ctx->{-obfs_ibx};