X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FView.pm;h=4058bee775507c70e0c1a73ca82235c4f9026f78;hb=476fc666c223f0fb;hp=98d0219dbc57c353163872c9269e63da16d67641;hpb=bc067a7562a586bed92401fe1084bbe423b9451a;p=public-inbox.git diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 98d0219d..4058bee7 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -11,11 +11,9 @@ use Date::Parse qw/str2time/; use Encode qw/find_encoding/; use Encode::MIME::Header; use Email::MIME::ContentType qw/parse_content_type/; -use PublicInbox::Hval; -use PublicInbox::MID qw/mid_clean id_compress mid2path/; -use Digest::SHA qw/sha1_hex/; -my $SALT = rand; -my $MBOX_TITLE = 'title="download thread as gzipped mbox"'; +use PublicInbox::Hval qw/ascii_html/; +use PublicInbox::Linkify; +use PublicInbox::MID qw/mid_clean id_compress mid2path mid_mime/; require POSIX; # TODO: make these constants tunable @@ -24,8 +22,6 @@ use constant MAX_TRUNC_LEN => 72; use constant T_ANCHOR => '#u'; use constant INDENT => ' '; -*ascii_html = *PublicInbox::Hval::ascii_html; - my $enc_utf8 = find_encoding('UTF-8'); # public functions: @@ -36,28 +32,68 @@ sub msg_html { } else { $footer = ''; } - headers_to_html_header($mime, $full_pfx, $ctx) . + my $hdr = $mime->header_obj; + headers_to_html_header($hdr, $full_pfx, $ctx) . multipart_text_as_html($mime, $full_pfx) . - '
' . + html_footer($hdr, 1, $full_pfx, $ctx) . $footer . '