#
# Used for displaying the HTML web interface.
# See Documentation/design_www.txt for this.
package PublicInbox::View;
use strict;
use warnings;
-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 qw/ascii_html/;
+use bytes (); # only for bytes::length
+use PublicInbox::MsgTime qw(msg_datestamp);
+use PublicInbox::Hval qw/ascii_html obfuscate_addrs/;
use PublicInbox::Linkify;
-use PublicInbox::MID qw/mid_clean id_compress mid2path mid_mime/;
+use PublicInbox::MID qw/id_compress mid_escape mids references/;
+use PublicInbox::MsgIter;
+use PublicInbox::Address;
+use PublicInbox::WwwStream;
+use PublicInbox::Reply;
+use PublicInbox::ViewDiff qw(flush_diff);
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 Time::Local qw(timegm);
+use PublicInbox::SearchMsg qw(subject_normalized);
+use constant COLS => 72;
use constant INDENT => ' ';
+use constant TCHILD => '` ';
+sub th_pfx ($) { $_[0] == 0 ? '' : TCHILD };
-my $enc_utf8 = find_encoding('UTF-8');
+# public functions: (unstable)
-# public functions:
sub msg_html {
- my ($ctx, $mime, $full_pfx, $footer) = @_;
- $footer = defined($footer) ? "\n$footer" : '';
+ my ($ctx, $mime, $more, $smsg) = @_;
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 .
- '