X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FView.pm;h=0b1ec75b31fd3f297bfcf85fdea29364ba5ede8a;hb=ccb66f35d293d3d0e3f9b119f7bd1fa019b93c75;hp=2b40bcdd37f31c7e0a715d130a59cd3fd0b4b675;hpb=1365e185d817cdc2de04968c37f597d92226a13b;p=public-inbox.git diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 2b40bcdd..0b1ec75b 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -8,12 +8,12 @@ use strict; use warnings; use URI::Escape qw/uri_escape_utf8/; use Date::Parse qw/str2time/; -use Encode::MIME::Header; 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; require POSIX; use constant INDENT => ' '; @@ -21,17 +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; - headers_to_html_header($hdr, $ctx) . - multipart_text_as_html($mime, '') . - '
' . - html_footer($hdr, 1, $ctx) . - '' . msg_reply($ctx, $hdr) . - '
'. $footer . '