about summary refs log tree commit homepage
path: root/lib/PublicInbox/SearchQuery.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/SearchQuery.pm')
-rw-r--r--lib/PublicInbox/SearchQuery.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/PublicInbox/SearchQuery.pm b/lib/PublicInbox/SearchQuery.pm
index ce1eae12..6724ae39 100644
--- a/lib/PublicInbox/SearchQuery.pm
+++ b/lib/PublicInbox/SearchQuery.pm
@@ -12,7 +12,8 @@ our $LIM = 200;
 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 {
@@ -21,6 +22,7 @@ sub new {
                 o => (($qp->{o} || '0') =~ /(-?[0-9]+)/),
                 l => $l,
                 r => (defined $r && $r ne '0'),
+                t => (defined $t && $t ne '0'),
         }, $class;
 }
 
@@ -41,8 +43,8 @@ sub qs_html {
         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');