Documentation/mknews.perl | 3 ++- lib/PublicInbox/Feed.pm | 3 +-- lib/PublicInbox/SearchView.pm | 3 +-- lib/PublicInbox/View.pm | 9 +++++---- diff --git a/Documentation/mknews.perl b/Documentation/mknews.perl index 4a5d0e563bc425a9539349c761059cbc12aa48f9..f053e2bfb9e558541778762a4d6b3b79bd0b633d 100755 --- a/Documentation/mknews.perl +++ b/Documentation/mknews.perl @@ -105,7 +105,8 @@ sub mime2html { my ($out, $eml, $ctx) = @_; my $smsg = $ctx->{smsg} = bless {}, 'PublicInbox::Smsg'; $smsg->populate($eml); - print $out PublicInbox::View::eml_entry($ctx, $eml, 1) or die; + $ctx->{msgs} = [ 1 ]; # for
in eml_entry + print $out PublicInbox::View::eml_entry($ctx, $eml) or die; } sub html_start { diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm index 476d946f515d2882e881d61ab3c0117c38042721..bf095a2cc8e3f7540e4baa66a792781956617431 100644 --- a/lib/PublicInbox/Feed.pm +++ b/lib/PublicInbox/Feed.pm @@ -51,8 +51,7 @@ sub new_html_i { my ($ctx, $eml) = @_; $ctx->zmore($ctx->html_top) if exists $ctx->{-html_tip}; - $eml and return PublicInbox::View::eml_entry($ctx, $eml, - scalar @{$ctx->{msgs}}); + $eml and return PublicInbox::View::eml_entry($ctx, $eml); my $smsg = shift @{$ctx->{msgs}} or $ctx->zmore(PublicInbox::View::pagination_footer( $ctx, './new.html')); diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm index 623b16fb22cd0d6282d01d001a16dd367531080e..84c04c6c4713923d73f5ed5cb856e8720d19c3df 100644 --- a/lib/PublicInbox/SearchView.pm +++ b/lib/PublicInbox/SearchView.pm @@ -294,8 +294,7 @@ # callback for PublicInbox::WwwStream::getline sub mset_thread_i { my ($ctx, $eml) = @_; $ctx->zmore($ctx->html_top) if exists $ctx->{-html_tip}; - $eml and return PublicInbox::View::eml_entry($ctx, $eml, - scalar @{$ctx->{msgs}}); + $eml and return PublicInbox::View::eml_entry($ctx, $eml); my $smsg = shift @{$ctx->{msgs}} or $ctx->zmore(${delete($ctx->{skel})}); $smsg; diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 60dad6bac0ec96679c0fb81b91f4f4a6824b73e9..d7ec4eb0a1a63f2500b911eaa4638bd7565e21a3 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -176,7 +176,7 @@ # Displays the text of of the message for /$INBOX/$MSGID/[Tt]/ endpoint # this is already inside a
 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};
@@ -267,7 +267,8 @@ 	} else {
 		$hr = $ctx->{-hr};
 	}
 
-	$rv .= $more ? '

' : '
' if $hr; + # do we have more messages? start a new
 if so
+	$rv .= scalar(@{$ctx->{msgs}}) ? '

' : '
' if $hr; $rv; } @@ -368,7 +369,7 @@ sub thread_eml_entry { my ($ctx, $eml) = @_; my ($beg, $end) = thread_adj_level($ctx, $ctx->{level}); - $beg . '
' . eml_entry($ctx, $eml, 0) . '
' . $end; + $beg . '
' . eml_entry($ctx, $eml) . '
' . $end; } sub next_in_queue ($$) { @@ -463,7 +464,7 @@ if (exists $ctx->{-html_tip}) { $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});