-# Copyright (C) 2016-2019 all contributors <meta@public-inbox.org>
+# Copyright (C) 2016-2020 all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
#
# Atom body stream for which yields getline+close methods
use POSIX qw(strftime);
use Digest::SHA qw(sha1_hex);
use PublicInbox::Address;
-use PublicInbox::Hval qw(ascii_html);
-use PublicInbox::MID qw(mid_escape);
+use PublicInbox::Hval qw(ascii_html mid_href);
use PublicInbox::MsgTime qw(msg_timestamp);
# called by PSGI server after getline:
my $mid = $ctx->{mid};
my $page_id;
if (defined $mid) { # per-thread
- $self_url .= mid_escape($mid).'/t.atom';
+ $self_url .= mid_href($mid).'/t.atom';
$page_id = to_uuid("t\n".$mid)
} elsif (defined $search_q) {
my $query = $search_q->{'q'};
my $base = $ctx->{feed_base_url};
if (defined $irt) {
my $irt_uuid = to_uuid($irt);
- $irt = mid_escape($irt);
+ $irt = mid_href($irt);
$irt = qq(<thr:in-reply-to\nref="$irt_uuid"\n).
qq(href="$base$irt/"/>);
} else {
$irt = '';
}
- my $href = $base . mid_escape($mid) . '/';
+ my $href = $base . mid_href($mid) . '/';
my $t = msg_timestamp($hdr);
my @t = gmtime(defined $t ? $t : time);
my $updated = feed_updated(@t);
qq{<div\nxmlns="http://www.w3.org/1999/xhtml">} .
qq(<pre\nstyle="white-space:pre-wrap">);
$ctx->{obuf} = \$s;
- PublicInbox::View::multipart_text_as_html($mime, $href, $ctx);
+ $ctx->{mhref} = $href;
+ PublicInbox::View::multipart_text_as_html($mime, $ctx);
delete $ctx->{obuf};
$s .= '</pre></div></content></entry>';
}