X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FView.pm;h=65788dbebc01717c6ae49db5563996f23855095d;hb=5c5dfb7d5558ff248477fa57aef08e2a8bbd9800;hp=6b6597dd0822d6d855fbf36b24ffb9d9f6cd3d28;hpb=9785032e18c97504fb5f83ed7d1a3585437e9ec9;p=public-inbox.git diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 6b6597dd..65788dbe 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -9,11 +9,13 @@ 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/; use PublicInbox::MsgIter; use PublicInbox::Address; +use PublicInbox::WwwStream; require POSIX; use constant INDENT => ' '; @@ -21,37 +23,46 @@ 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 $hdr = $mime->header_obj; - headers_to_html_header($hdr, $ctx) . - multipart_text_as_html($mime, '') . - '
' . - html_footer($hdr, 1, $ctx) . - '' . msg_reply($ctx, $hdr) . - '
'. $footer . '