if (my $smsg = $ctx->{smsg} = $ctx->{cb}->($ctx)) {
$ctx->smsg_blob($smsg);
} else {
- $ctx->{http_out}->write($ctx->translate('</feed>'));
+ $ctx->write('</feed>');
$ctx->close;
}
};
sub async_eml { # for async_blob_cb
my ($ctx, $eml) = @_;
my $smsg = delete $ctx->{smsg};
- $ctx->{http_out}->write($ctx->translate(feed_entry($ctx, $smsg, $eml)))
+ $ctx->write(feed_entry($ctx, $smsg, $eml));
}
sub response {
} else {
$title = title_tag($ibx->description);
$self_url .= 'new.atom';
- $page_id = "mailto:$ibx->{-primary_address}";
+ if (defined(my $addr = $ibx->{-primary_address})) {
+ $page_id = "mailto:$addr";
+ } else {
+ $page_id = to_uuid($self_url);
+ }
}
qq(<?xml version="1.0" encoding="us-ascii"?>\n) .
qq(<feed\nxmlns="http://www.w3.org/2005/Atom"\n) .
}
sub feed_updated {
- '<updated>' . strftime('%Y-%m-%dT%H:%M:%SZ', gmtime(@_)) . '</updated>';
+ my ($t) = @_;
+ '<updated>' . strftime('%Y-%m-%dT%H:%M:%SZ', gmtime($t)) . '</updated>';
}
1;