# Displays the text of of the message for /$INBOX/$MSGID/[Tt]/ endpoint
# this is already inside a <pre>
sub eml_entry {
- my ($ctx, $eml, $more) = @_;
+ my ($ctx, $eml) = @_;
my $smsg = delete $ctx->{smsg};
my $subj = delete $smsg->{subject};
my $mid_raw = $smsg->{mid};
$hr = $ctx->{-hr};
}
- $rv .= $more ? '</pre><hr><pre>' : '</pre>' if $hr;
+ # do we have more messages? start a new <pre> if so
+ $rv .= scalar(@{$ctx->{msgs}}) ? '</pre><hr><pre>' : '</pre>' if $hr;
$rv;
}
sub thread_eml_entry {
my ($ctx, $eml) = @_;
my ($beg, $end) = thread_adj_level($ctx, $ctx->{level});
- $beg . '<pre>' . eml_entry($ctx, $eml, 0) . '</pre>' . $end;
+ $beg . '<pre>' . eml_entry($ctx, $eml) . '</pre>' . $end;
}
sub next_in_queue ($$) {
PublicInbox::WwwStream::aresponse($ctx, 200, \&stream_thread_i);
}
-# /$INBOX/$MESSAGE_ID/t/
+# /$INBOX/$MSGID/t/ and /$INBOX/$MSGID/T/
sub thread_html {
my ($ctx) = @_;
my $mid = $ctx->{mid};
$ctx->{-title_html} = ascii_html($smsg->{subject});
$ctx->zmore($ctx->html_top);
}
- return eml_entry($ctx, $eml, scalar @{$ctx->{msgs}});
+ return eml_entry($ctx, $eml);
} else {
while (my $smsg = shift @{$ctx->{msgs}}) {
return $smsg if exists($smsg->{blob});