X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=blobdiff_plain;f=lib%2FPublicInbox%2FFeed.pm;h=ff20d7faaef792fd91ba39d7d9627804a81d794b;hp=2f59f8c2939b258d0c028c07a323cbb85380fcfb;hb=87dca6d8d5988c5eb54019cca342450b0b7dd6b7;hpb=3cc5ff405d9054fbf47ac44774fca4f9a72ff65a diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm index 2f59f8c2..ff20d7fa 100644 --- a/lib/PublicInbox/Feed.pm +++ b/lib/PublicInbox/Feed.pm @@ -27,14 +27,13 @@ sub generate { sub generate_thread_atom { my ($ctx) = @_; my $mid = $ctx->{mid}; - my $res = $ctx->{srch}->get_thread($mid); - return _no_thread() unless $res->{total}; + my $msgs = $ctx->{srch}->get_thread($mid); + return _no_thread() unless @$msgs; my $ibx = $ctx->{-inbox}; my $html_url = $ibx->base_url($ctx->{env}); $html_url .= PublicInbox::Hval->new_msgid($mid)->{href}; $ctx->{-html_url} = $html_url; - my $msgs = $res->{msgs}; PublicInbox::WwwAtomStream->response($ctx, 200, sub { while (my $smsg = shift @$msgs) { $ibx->smsg_mime($smsg) and return $smsg; @@ -114,10 +113,10 @@ sub recent_msgs { my $o = $qp ? $qp->{o} : 0; $o += 0; $o = 0 if $o < 0; - my $res = $ibx->recent({ limit => $max, offset => $o }); + my $msgs = $ibx->recent({ limit => $max, offset => $o }); my $next = $o + $max; - $ctx->{next_page} = "o=$next" if $res->{total} >= $next; - return $res->{msgs}; + $ctx->{next_page} = "o=$next" if scalar(@$msgs) == $max; + return $msgs; } my $hex = '[a-f0-9]';