-# Copyright (C) 2015-2020 all contributors <meta@public-inbox.org>
+# Copyright (C) 2015-2021 all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
# used by PublicInbox::SearchView
sub new {
my ($class, $qp) = @_;
- my $r = $qp->{r};
+ my $r = $qp->{r}; # relevance
+ my $t = $qp->{t}; # collapse threads
my ($l) = (($qp->{l} || '') =~ /([0-9]+)/);
$l = $LIM if !$l || $l > $LIM;
bless {
o => (($qp->{o} || '0') =~ /(-?[0-9]+)/),
l => $l,
r => (defined $r && $r ne '0'),
+ t => (defined $t && $t ne '0'),
}, $class;
}
if (my $l = $self->{l}) {
$qs .= "&l=$l" unless $l == $LIM;
}
- if (my $r = $self->{r}) {
- $qs .= "&r";
+ for my $bool (qw(r t)) {
+ $qs .= "&$bool" if $self->{$bool};
}
if (my $x = $self->{x}) {
$qs .= "&x=$x" if ($x eq 't' || $x eq 'A' || $x eq 'm');