]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Feed.pm
update copyrights for 2018
[public-inbox.git] / lib / PublicInbox / Feed.pm
index 31d82adbb634d478e2354e43348ebda1401ed429..c32e7bde92db7f10864be24ee9bcda497b16dd54 100644 (file)
@@ -1,16 +1,13 @@
-# Copyright (C) 2013-2015 all contributors <meta@public-inbox.org>
-# License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt)
+# Copyright (C) 2013-2018 all contributors <meta@public-inbox.org>
+# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 #
 # Used for generating Atom feeds for web-accessible mailing list archives.
 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 {
@@ -42,7 +39,7 @@ sub generate_thread_atom {
        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);
                }
        });
 }
@@ -114,7 +111,7 @@ sub new_html_footer {
 
 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})$!;
@@ -178,7 +175,7 @@ sub each_recent_blob {
 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;