my ($class, $ctx, $cb) = @_;
$ctx->{emit_header} = 1;
$ctx->{feed_base_url} = $ctx->{-inbox}->base_url($ctx->{env});
- bless { cb => $cb || *close, ctx => $ctx }, $class;
+ bless { cb => $cb || \&close, ctx => $ctx }, $class;
}
sub response {
sub feed_entry {
my ($self, $smsg) = @_;
my $ctx = $self->{ctx};
- my $mime = $smsg->{mime};
+ my $mid = $smsg->mid; # may extract Message-ID from {mime}
+ my $mime = delete $smsg->{mime};
my $hdr = $mime->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};
"<id>$uuid</id>$irt" .
qq{<content\ntype="xhtml">} .
qq{<div\nxmlns="http://www.w3.org/1999/xhtml">} .
- qq(<pre\nstyle="white-space:pre-wrap">) .
- PublicInbox::View::multipart_text_as_html($mime, $href, $ctx) .
- '</pre></div></content></entry>';
+ qq(<pre\nstyle="white-space:pre-wrap">);
+ $ctx->{obuf} = \$s;
+ PublicInbox::View::multipart_text_as_html($mime, $href, $ctx);
+ delete $ctx->{obuf};
+ $s .= '</pre></div></content></entry>';
}
sub feed_updated {