package PublicInbox::Feed;
use strict;
use warnings;
-use Email::MIME;
+use PublicInbox::MIME;
use PublicInbox::View;
use PublicInbox::WwwAtomStream;
-use constant {
- MAX_PER_PAGE => 25, # this needs to be tunable
-};
# main function
sub generate {
PublicInbox::WwwAtomStream->response($ctx, 200, sub {
while (my $msg = shift @$msgs) {
$msg = $ibx->msg_by_smsg($msg) and
- return Email::MIME->new($msg);
+ return PublicInbox::MIME->new($msg);
}
});
}
sub each_recent_blob {
my ($ctx, $cb) = @_;
- my $max = $ctx->{max} || MAX_PER_PAGE;
+ my $max = $ctx->{-inbox}->{feedmax};
my $hex = '[a-f0-9]';
my $addmsg = qr!^:000000 100644 \S+ \S+ A\t(${hex}{2}/${hex}{38})$!;
my $delmsg = qr!^:100644 000000 \S+ \S+ D\t(${hex}{2}/${hex}{38})$!;
sub do_cat_mail {
my ($ibx, $path) = @_;
my $mime = eval { $ibx->msg_by_path($path) } or return;
- Email::MIME->new($mime);
+ PublicInbox::MIME->new($mime);
}
1;