diff options
author | Eric Wong <e@80x24.org> | 2019-05-21 23:22:05 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2019-05-21 23:22:05 +0000 |
commit | e220b8b2ee5cfd458167dc2c6c92726352c4c80e (patch) | |
tree | 367fea0f8e7b2e23a313cccca1b2dac604e166b8 /lib/PublicInbox/Feed.pm | |
parent | 1cb0e9b176774e3ff5e2397f4a1452bb2517454f (diff) | |
parent | d0e8bfd866ed1e924e8d9f551939eecbea4920ef (diff) | |
download | public-inbox-e220b8b2ee5cfd458167dc2c6c92726352c4c80e.tar.gz |
* origin/xap-optional: admin: improve warnings and errors for missing modules searchidx: do not create empty Xapian partitions for basic lazy load Xapian and make it optional for v2 www: use Inbox->over where appropriate nntp: use Inbox->over directly inbox: add ->over method to ease access
Diffstat (limited to 'lib/PublicInbox/Feed.pm')
-rw-r--r-- | lib/PublicInbox/Feed.pm | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm index b373a1eb..a04838a1 100644 --- a/lib/PublicInbox/Feed.pm +++ b/lib/PublicInbox/Feed.pm @@ -27,10 +27,10 @@ sub generate { sub generate_thread_atom { my ($ctx) = @_; my $mid = $ctx->{mid}; - my $msgs = $ctx->{srch}->get_thread($mid); + my $ibx = $ctx->{-inbox}; + my $msgs = $ibx->over->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; @@ -46,12 +46,13 @@ 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}; - if ($qp && !$qp->{r} && $ctx->{srch}) { + my $ibx = $ctx->{-inbox}; + if ($qp && !$qp->{r} && $ibx->over) { return PublicInbox::View::index_topics($ctx); } my $env = $ctx->{env}; - my $url = $ctx->{-inbox}->base_url($env) . 'new.html'; + my $url = $ibx->base_url($env) . 'new.html'; my $qs = $env->{QUERY_STRING}; $url .= "?$qs" if $qs ne ''; [302, [ 'Location', $url, 'Content-Type', 'text/plain'], @@ -94,7 +95,7 @@ sub recent_msgs { if ($v > 2) { die "BUG: unsupported inbox version: $v\n"; } - if (my $srch = $ibx->search) { + if ($ibx->over) { return PublicInbox::View::paginate_recent($ctx, $max); } |