X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FWwwAtomStream.pm;h=33da32443c0f941cb01ce6de07a625b03d176097;hb=ab9c03ff4aa369b397dc1a8c8936153c8565fd05;hp=7b7047ac26d39e9647d3866d3a65801ca2dbaf54;hpb=81ea7f0100f016ad8c66605b49230e876a1eb82d;p=public-inbox.git diff --git a/lib/PublicInbox/WwwAtomStream.pm b/lib/PublicInbox/WwwAtomStream.pm index 7b7047ac..33da3244 100644 --- a/lib/PublicInbox/WwwAtomStream.pm +++ b/lib/PublicInbox/WwwAtomStream.pm @@ -1,4 +1,4 @@ -# Copyright (C) 2016-2021 all contributors +# Copyright (C) all contributors # License: AGPL-3.0+ # # Atom body stream for HTTP responses @@ -43,10 +43,10 @@ sub async_eml { # for async_blob_cb } sub response { - my ($class, $ctx, $code, $cb) = @_; + my ($class, $ctx, $cb) = @_; my $res_hdr = [ 'Content-Type' => 'application/atom+xml' ]; $class->new($ctx, $cb); - $ctx->psgi_response($code, $res_hdr); + $ctx->psgi_response(200, $res_hdr); } # called once for each message by PSGI server @@ -146,19 +146,19 @@ sub feed_entry { my $name = ascii_html(join(', ', PublicInbox::Address::names($from))); $email = ascii_html($email // $ctx->{ibx}->{-primary_address}); - my $s = delete($ctx->{emit_header}) ? atom_header($ctx, $title) : ''; - $s .= "$name$email" . + print { $ctx->zfh } + (delete($ctx->{emit_header}) ? atom_header($ctx, $title) : ''), + "$name$email" . "$title$updated" . - qq(). + qq() . "$uuid$irt" . qq{} . qq{} . qq(); - $ctx->{obuf} = \$s; $ctx->{mhref} = $href; - PublicInbox::View::multipart_text_as_html($eml, $ctx); - delete $ctx->{obuf}; - $s .= ''; + $ctx->{changed_href} = "${href}#related"; + $eml->each_part(\&PublicInbox::View::add_text_body, $ctx, 1); + ''; } sub feed_updated {