- my $hdr = $mime->header_obj;
- my $mid = mid_clean($hdr->header_raw('Message-ID'));
-
- my $uuid = mid2path($mid);
- $uuid =~ tr!/!!d;
- my $h = '[a-f0-9]';
- my (@uuid5) = ($uuid =~ m!\A($h{8})($h{4})($h{4})($h{4})($h{12})!o);
- $uuid = 'urn:uuid:' . join('-', @uuid5);
-
- $mid = PublicInbox::Hval->new_msgid($mid);
- my $href = $ctx->{feed_base_url} . $mid->{href}. '/';
-
- my $date = $hdr->header('Date');
- my @t = eval { strptime($date) } if defined $date;
- @t = gmtime(time) unless scalar @t;
- my $updated = feed_updated(@t);
+ my $eml = $ctx->{-inbox}->smsg_eml($smsg) or return '';
+ my $hdr = $eml->header_obj;
+ my $mid = $smsg->{mid};
+ my $irt = PublicInbox::View::in_reply_to($hdr);
+ my $uuid = to_uuid($mid);
+ my $base = $ctx->{feed_base_url};
+ if (defined $irt) {
+ my $irt_uuid = to_uuid($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_href($mid) . '/';
+ my $updated = feed_updated(msg_timestamp($hdr));