X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FWWW.pm;h=1f28df20fbcae79a0461a4003834a1d9671b0500;hb=62a77b55c9fadec1b4b1ba061e99f4a18d8a14bc;hp=77910f671d3979e17de6e3345bb99fb9068b1402;hpb=09b11c8725e3a19d3c126c3d3e993caa0169a268;p=public-inbox.git diff --git a/lib/PublicInbox/WWW.pm b/lib/PublicInbox/WWW.pm index 77910f67..1f28df20 100644 --- a/lib/PublicInbox/WWW.pm +++ b/lib/PublicInbox/WWW.pm @@ -21,7 +21,7 @@ require PublicInbox::Git; use PublicInbox::GitHTTPBackend; our $LISTNAME_RE = qr!\A/([\w\.\-]+)!; our $MID_RE = qr!([^/]+)!; -our $END_RE = qr!(f/|T/|t/|t\.mbox(?:\.gz)?|t\.atom|raw|)!; +our $END_RE = qr!(f/|T/|t/|R/|t\.mbox(?:\.gz)?|t\.atom|raw|)!; our $pi_config; sub run { @@ -58,7 +58,7 @@ sub run { msg_page($ctx, $1, $2, $3); # in case people leave off the trailing slash: - } elsif ($path_info =~ m!$LISTNAME_RE/$MID_RE/(f|T|t)\z!o) { + } elsif ($path_info =~ m!$LISTNAME_RE/$MID_RE/(f|T|t|R)\z!o) { my ($listname, $mid, $suffix) = ($1, $2, $3); $suffix .= $suffix =~ /\A[tT]\z/ ? '/#u' : '/'; r301($ctx, $listname, $mid, $suffix); @@ -200,6 +200,19 @@ sub get_full_html { [ PublicInbox::View::msg_html($ctx, $mime, undef, $foot)] ]; } +# /$LISTNAME/$MESSAGE_ID/R/ -> HTML content (fullquotes) +sub get_reply_html { + my ($ctx) = @_; + my $x = mid2blob($ctx) or return r404($ctx); + + require PublicInbox::View; + my $foot = footer($ctx); + require Email::MIME; + my $hdr = Email::MIME->new($x)->header_obj; + [ 200, [ 'Content-Type' => 'text/html; charset=UTF-8' ], + [ PublicInbox::View::msg_reply($ctx, $hdr, $foot)] ]; +} + # /$LISTNAME/$MESSAGE_ID/t/ sub get_thread { my ($ctx, $flat) = @_; @@ -407,6 +420,7 @@ sub msg_page { 'T/' eq $e and return get_thread($ctx, 1); 'raw' eq $e and return get_mid_txt($ctx); 'f/' eq $e and return get_full_html($ctx); + 'R/' eq $e and return get_reply_html($ctx); } r404($ctx); }