- my ($class, $args) = @_;
- require XML::Atom::SimpleFeed;
- require POSIX;
- my $max = $args->{max} || MAX_PER_PAGE;
-
- my $feed_opts = get_feedopts($args);
- my $addr = $feed_opts->{address};
- $addr = $addr->[0] if ref($addr);
- my $feed = XML::Atom::SimpleFeed->new(
- title => $feed_opts->{description} || "unnamed feed",
- link => $feed_opts->{url} || "http://example.com/",
- link => {
- rel => 'self',
- href => $feed_opts->{atomurl} ||
- "http://example.com/atom.xml",
- },
- id => 'mailto:' . ($addr || 'public-inbox@example.com'),
- updated => POSIX::strftime(DATEFMT, gmtime),
- );
-
- my $git = PublicInbox::GitCatFile->new($args->{git_dir});
- each_recent_blob($args, sub {
- my ($add) = @_;
- add_to_feed($feed_opts, $feed, $add, $git);
- });
- $git = undef; # destroy pipes
- Email::Address->purge_cache;
- $feed->as_string;
+ my ($ctx) = @_;
+ sub { emit_atom($_[0], $ctx) };
+}
+
+sub generate_thread_atom {
+ my ($ctx) = @_;
+ sub { emit_atom_thread($_[0], $ctx) };