[PATCH lists.sr.ht] Add is:thread & is:reply filters
Export this patch
Also, fix bug where 'in_reply_to' never gets set.
Closes https://todo.sr.ht/~sircmpwn/lists.sr.ht/82.
---
listssrht/blueprints/archives.py | 2 ++
listssrht/process.py | 1 +
2 files changed, 3 insertions(+)
diff --git a/listssrht/blueprints/archives.py b/listssrht/blueprints/archives.py
index 7adc70b..cf2c385 100644
--- a/listssrht/blueprints/archives.py
+++ b/listssrht/blueprints/archives.py
@@ -76,7 +76,9 @@ def apply_search(query, terms=None):
return search(query, terms, [Email.body, Email.subject], {
"is": lambda q, v: q.filter({
"patch": Email.is_patch,
+ "reply": Email.parent_id != None,
"request-pull": Email.is_request_pull,
+ "thread": Email.nreplies > 0,
}.get(v, False)),
"from": lambda q, v: me_alias("From", q, v),
"to": lambda q, v: me_alias("To", q, v),
diff --git a/listssrht/process.py b/listssrht/process.py
index 3e69544..f4b31c4 100644
--- a/listssrht/process.py
+++ b/listssrht/process.py
@@ -186,6 +186,7 @@ def _archive(dest, envelope):
if parent is not None:
mail.parent_id = parent.id
mail.parent = parent
+ mail.in_reply_to = reply_to
thread = mail
while thread.parent_id:
--
2.23.0
Thanks! Applied your patch.