about summary refs log tree commit homepage
path: root/lib/PublicInbox/xap_helper.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/xap_helper.h')
-rw-r--r--lib/PublicInbox/xap_helper.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/PublicInbox/xap_helper.h b/lib/PublicInbox/xap_helper.h
index 872f063d..5a89544a 100644
--- a/lib/PublicInbox/xap_helper.h
+++ b/lib/PublicInbox/xap_helper.h
@@ -141,7 +141,6 @@ struct req { // argv and pfxv point into global rbuf
         bool collapse_threads;
         bool code_search;
         bool relevance; // sort by relevance before column
-        bool emit_percent;
         bool asc; // ascending sort
 };
 
@@ -225,6 +224,13 @@ static Xapian::MSet mail_mset(struct req *req, const char *qry_str)
                 qry = Xapian::Query(Xapian::Query::OP_FILTER, qry,
                                         Xapian::Query(req->Oeidx_key));
         }
+        // TODO: uid_range
+        if (req->threadid != ULLONG_MAX) {
+                std::string tid = Xapian::sortable_serialise(req->threadid);
+                qry = Xapian::Query(Xapian::Query::OP_FILTER, qry,
+                        Xapian::Query(Xapian::Query::OP_VALUE_RANGE, THREADID,
+                                        tid, tid));
+        }
         Xapian::Enquire enq = prep_enquire(req);
         enq.set_query(qry);
         // THREADID is a CPP macro defined on CLI (see) XapHelperCxx.pm
@@ -632,7 +638,6 @@ static void dispatch(struct req *req)
                         if (*end || req->off == ULLONG_MAX)
                                 ABORT("-o %s", optarg);
                         break;
-                case 'p': req->emit_percent = true; break;
                 case 'r': req->relevance = true; break;
                 case 't': req->collapse_threads = true; break;
                 case 'A':