X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FView.pm;h=a78ce31d291ea0859edc5cf75a7e2d253579c3a2;hb=23a4e44bedabe5b8b651346cabc2a870c5377a30;hp=204004709474d914e6cca17adc09e3e0f74f70cb;hpb=430a7799c319df9dcef0dae0a5aa0add0a40d6a1;p=public-inbox.git diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 20400470..a78ce31d 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -10,54 +10,75 @@ use URI::Escape qw/uri_escape_utf8/; 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; +use PublicInbox::Hval qw/ascii_html/; +use PublicInbox::Linkify; +use PublicInbox::MID qw/mid_clean id_compress mid2path mid_mime/; +use PublicInbox::MsgIter; +use PublicInbox::Address; require POSIX; -# TODO: make these constants tunable -use constant MAX_INLINE_QUOTED => 12; # half an 80x24 terminal -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'); +use constant TCHILD => '` '; +sub th_pfx ($) { $_[0] == 0 ? '' : TCHILD }; # public functions: sub msg_html { - my ($ctx, $mime, $full_pfx, $footer) = @_; - if (defined $footer) { - $footer = "\n" . $footer; - } else { - $footer = ''; - } - headers_to_html_header($mime, $full_pfx, $ctx) . - multipart_text_as_html($mime, $full_pfx) . + 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($mime, 1, $full_pfx, $ctx) .
+		html_footer($hdr, 1, $ctx, 'R/') .
 		$footer .
 		'
'; } -sub feed_entry { - my ($class, $mime, $full_pfx) = @_; - - # no here for