X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FView.pm;h=2d816408cee5ca7437cbe0b11fde8084f363f67e;hb=ef3ca9b80fcb464d851c2f8d87f3f02f4f70986d;hp=534f85ef9b8110ca86e992d18118be2499786309;hpb=31afda256c813443062e0504213d41732e50ee45;p=public-inbox.git diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 534f85ef..2d816408 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -6,15 +6,14 @@ package PublicInbox::View; use strict; use warnings; -use URI::Escape qw/uri_escape_utf8/; use Date::Parse qw/str2time/; -use Encode::MIME::Header; -use Plack::Util; use PublicInbox::Hval qw/ascii_html/; use PublicInbox::Linkify; -use PublicInbox::MID qw/mid_clean id_compress mid2path mid_mime/; +use PublicInbox::MID qw/mid_clean id_compress mid_mime mid_escape/; use PublicInbox::MsgIter; use PublicInbox::Address; +use PublicInbox::WwwStream; +use PublicInbox::Reply; require POSIX; use constant INDENT => ' '; @@ -22,31 +21,26 @@ use constant TCHILD => '` '; sub th_pfx ($) { $_[0] == 0 ? '' : TCHILD }; # public functions: (unstable) -# TODO: stream this, since threading is expensive but also oh-so-important sub msg_html { - my ($ctx, $mime, $footer) = @_; - $footer = defined($footer) ? "\n$footer" : ''; + my ($ctx, $mime) = @_; my $hdr = $mime->header_obj; - my $n = 0; - Plack::Util::inline_object( - close => sub {}, # noop - getline => sub { - my $nr = $n++; - if ($nr == 0) { - headers_to_html_header($hdr, $ctx) . - multipart_text_as_html($mime, '') . - '
' . - html_footer($hdr, 1, $ctx) . - '' . msg_reply($ctx, $hdr) . - '
'. $footer . - '