]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/View.pm
treewide: ditch inbox->recent method
[public-inbox.git] / lib / PublicInbox / View.pm
index 158feb6ab3d5a6a933e04c41bf44dd1dd9a82aaf..466ec6cfdad1c0677211878498d0db288e170247 100644 (file)
@@ -64,7 +64,7 @@ sub no_over_html ($) {
        }
        delete $ctx->{obuf};
        eval { $$obuf .= html_footer($ctx, $eml) };
-       html_oneshot($ctx, 200, $obuf);
+       html_oneshot($ctx, 200, $$obuf);
 }
 
 # public functions: (unstable)
@@ -1188,9 +1188,9 @@ sub dump_topics {
 
                my $s = "<a\nhref=\"$href/T/$anchor\">$top_subj</a>\n" .
                        " $ds UTC $n\n";
-               for (my $i = 0; $i < scalar(@extra); $i += 2) {
-                       my $level = $extra[$i];
-                       my $subj = $extra[$i + 1]; # already normalized
+               while (@extra) {
+                       my $level = shift @extra;
+                       my $subj = shift @extra; # already normalized
                        $mid = delete $seen->{$subj};
                        my @subj = split(/ /, $subj);
                        my @next_prev = @subj; # full copy
@@ -1222,7 +1222,7 @@ sub pagination_footer ($$) {
                $next = $next ? "$next | " : '             | ';
                $prev .= qq[ | <a\nhref="$latest">latest</a>];
        }
-       ($next || $prev) ? \"<hr><pre>page: $next$prev</pre>" : \'';
+       ($next || $prev) ? "<hr><pre>page: $next$prev</pre>" : '';
 }
 
 sub paginate_recent ($$) {
@@ -1237,12 +1237,11 @@ sub paginate_recent ($$) {
        $t =~ s/\A([0-9]{8,14})-// and $after = str2ts($1);
        $t =~ /\A([0-9]{8,14})\z/ and $before = str2ts($1);
 
-       my $ibx = $ctx->{ibx};
-       my $msgs = $ibx->recent($opts, $after, $before);
+       my $msgs = $ctx->{ibx}->over->recent($opts, $after, $before);
        my $nr = scalar @$msgs;
        if ($nr < $lim && defined($after)) {
                $after = $before = undef;
-               $msgs = $ibx->recent($opts);
+               $msgs = $ctx->{ibx}->over->recent($opts);
                $nr = scalar @$msgs;
        }
        my $more = $nr == $lim;