X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FView.pm;h=27dd15541a34eed0e4b9c0bd6eaf45f5c8013274;hb=e158d56a54d3c6d4890aa6ac4caa28a834279af0;hp=44130b904d94c32fc3356268f6265e39f1ee02c5;hpb=e29518088b3f4a4759280f76dd5416c376ee683e;p=public-inbox.git diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 44130b90..27dd1554 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -27,7 +27,7 @@ sub msg_html { my ($ctx, $mime, $footer) = @_; my $hdr = $mime->header_obj; my $tip = _msg_html_prepare($hdr, $ctx); - PublicInbox::WwwStream->new($ctx, sub { + PublicInbox::WwwStream->response($ctx, 200, sub { my ($nr, undef) = @_; if ($nr == 1) { $tip . multipart_text_as_html($mime, '') . @@ -49,7 +49,8 @@ sub msg_html { # /$INBOX/$MESSAGE_ID/#R sub msg_reply { my ($ctx, $hdr) = @_; - my $se_url = 'https://git-htmldocs.bogomips.org/git-send-email.html'; + my $se_url = + 'https://kernel.org/pub/software/scm/git/docs/git-send-email.html'; my ($arg, $link) = mailto_arg_link($hdr); push @$arg, '/path/to/YOUR_REPLY'; @@ -128,7 +129,7 @@ sub index_entry { my $mapping = $ctx->{mapping}; if (!$mapping && $irt) { - my $mirt = PublicInbox::Hval->msgid($irt); + my $mirt = PublicInbox::Hval->new_msgid($irt); my $href = $upfx . $mirt->as_href . '/'; my $html = $mirt->as_html; $rv .= qq(In-Reply-To: <$html>\n) @@ -154,8 +155,9 @@ sub index_entry { } else { $threaded = "$threaded"; } - $rv .= " [$threaded"; - $rv .= "|$flat]"; + $rv .= " / [$flat"; + $rv .= "|$threaded]"; + $rv .= " / $ctx->{s_nr}"; } $rv .= $more ? "\n\n" : "\n"; @@ -225,7 +227,8 @@ sub _th_index_lite { $rv .= $pad . $mapping->{$nn->messageid}->[1]; } } - $rv .= "_ $s_s, $s_c\n"; + $rv .= "_ "; + $rv .= "$s_s, $s_c; $ctx->{s_nr}\n"; } sub walk_thread { @@ -275,7 +278,7 @@ sub stream_thread ($$) { $mime = Email::MIME->new($mime); $ctx->{-title_html} = ascii_html($mime->header('Subject')); $ctx->{-html_tip} = thread_index_entry($ctx, $level, $mime); - my $body = PublicInbox::WwwStream->new($ctx, sub { + PublicInbox::WwwStream->response($ctx, 200, sub { return unless $ctx; while (@q) { $level = shift @q; @@ -294,7 +297,6 @@ sub stream_thread ($$) { $ctx = undef; $ret; }); - [ 200, ['Content-Type', 'text/html; charset=UTF-8'], $body ]; } sub thread_html { @@ -318,6 +320,7 @@ sub thread_html { $ctx->{root_anchor} = anchor_for($mid); $ctx->{seen} = {}; $ctx->{mapping} = {}; + $ctx->{s_nr} = "$nr+ messages in thread"; my $th = thread_results($msgs); walk_thread($th, $ctx, *pre_thread); @@ -335,7 +338,7 @@ sub thread_html { $ctx->{-title_html} = ascii_html($mime->header('Subject')); $ctx->{-html_tip} = '
'.index_entry($mime, $ctx, scalar @$msgs);
 	$mime = undef;
-	my $body = PublicInbox::WwwStream->new($ctx, sub {
+	PublicInbox::WwwStream->response($ctx, 200, sub {
 		return unless $msgs;
 		while ($mime = shift @$msgs) {
 			$mid = mid_clean(mid_mime($mime));
@@ -348,7 +351,6 @@ sub thread_html {
 		$msgs = undef;
 		'
'.$skel; }); - [ 200, ['Content-Type', 'text/html; charset=UTF-8'], $body ]; } sub multipart_text_as_html { @@ -498,7 +500,7 @@ sub thread_skel { my $mid = mid_clean($hdr->header_raw('Message-ID')); my $sres = $srch->get_thread($mid); my $nr = $sres->{total}; - my $expand = qq(expand ) . + my $expand = qq(expand ) . qq(/ mbox.gz ) . qq(/ Atom feed); @@ -869,7 +871,7 @@ sub emit_topics { } $subj = PublicInbox::Hval->new($subj)->as_html; - $cur->[1] .= "$subj\n"; + $cur->[1] .= "$subj\n"; $ts = fmt_ts($ts); my $attr = " $ts UTC";