lib/PublicInbox/View.pm | 35 +++++++++++++++-------------------- diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 040604b08b926552aa797725e3960bebeeacb0ee..0eb20ae0d7f7f8bc2d1ba103ae70ee151614f72a 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -40,11 +40,7 @@ } elsif ($nr == $ctx->{end_nr}) { # fake an EOF if generating the footer fails; # we want to at least show the message if something # here crashes: - eval { - my $hdr = delete($ctx->{hdr}); - '
' . html_footer($hdr, 1, $ctx) . - '' . msg_reply($ctx, $hdr) - }; + eval { html_footer($ctx) }; } else { undef } @@ -113,7 +109,7 @@ $str; } # /$INBOX/$MESSAGE_ID/#R -sub msg_reply { +sub msg_reply ($$) { my ($ctx, $hdr) = @_; my $se_url = 'https://kernel.org/pub/software/scm/git/docs/git-send-email.html'; @@ -800,17 +796,17 @@ } $rv; } +# returns a string buffer via ->getline sub html_footer { - my ($hdr, $standalone, $ctx, $rhref) = @_; - - my $ibx = $ctx->{-inbox} if $ctx; + my ($ctx) = @_; + my $ibx = $ctx->{-inbox}; + my $hdr = delete $ctx->{hdr}; my $upfx = '../'; - my $tpfx = ''; - my $skel = $standalone ? " index" : ''; - my $irt = ''; - if ($skel && $ibx->over) { + my $skel = " index"; + my $rv = '
';
+ if ($ibx->over) {
$skel .= "\n";
- thread_skel(\$skel, $ctx, $hdr, $tpfx);
+ thread_skel(\$skel, $ctx, $hdr, '');
my ($next, $prev);
my $parent = ' ';
$next = $prev = ' ';
@@ -839,13 +835,12 @@ }
} elsif ($u) { # unlikely
$parent = " parent";
}
- $irt = "$next $prev$parent ";
- } else {
- $irt = '';
+ $rv .= "$next $prev$parent ";
}
- $rhref ||= '#R';
- $irt .= qq(reply);
- $irt .= $skel;
+ $rv .= qq(reply);
+ $rv .= $skel;
+ $rv .= '';
+ $rv .= msg_reply($ctx, $hdr);
}
sub linkify_ref_no_over {