]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Feed.pm
imap+nntp: share COMPRESS implementation
[public-inbox.git] / lib / PublicInbox / Feed.pm
index 805076f0e1294cb577108aea449850958922a20e..b2219dad9955005c2cb97d0fe3d47b710d617837 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2013-2020 all contributors <meta@public-inbox.org>
+# Copyright (C) 2013-2021 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.
@@ -24,7 +24,7 @@ sub generate {
 
 sub generate_thread_atom {
        my ($ctx) = @_;
-       my $msgs = $ctx->{msgs} = $ctx->{-inbox}->over->get_thread($ctx->{mid});
+       my $msgs = $ctx->{msgs} = $ctx->{ibx}->over->get_thread($ctx->{mid});
        return _no_thread() unless @$msgs;
        PublicInbox::WwwAtomStream->response($ctx, 200, \&generate_i);
 }
@@ -34,7 +34,7 @@ sub generate_html_index {
        # if the 'r' query parameter is given, it is a legacy permalink
        # which we must continue supporting:
        my $qp = $ctx->{qp};
-       my $ibx = $ctx->{-inbox};
+       my $ibx = $ctx->{ibx};
        if ($qp && !$qp->{r} && $ibx->over) {
                return PublicInbox::View::index_topics($ctx);
        }
@@ -79,8 +79,8 @@ sub _no_thread () {
 
 sub recent_msgs {
        my ($ctx) = @_;
-       my $ibx = $ctx->{-inbox};
-       my $max = $ibx->{feedmax};
+       my $ibx = $ctx->{ibx};
+       my $max = $ibx->{feedmax} // 25;
        return PublicInbox::View::paginate_recent($ctx, $max) if $ibx->over;
 
        # only for rare v1 inboxes which aren't indexed at all