~sircmpwn/sr.ht-dev

lists.sr.ht: Add is:thread & is:reply filters v1 PROPOSED

Siva Mahadevan: 1
 Add is:thread & is:reply filters

 2 files changed, 3 insertions(+), 0 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/sr.ht-dev/patches/8335/mbox | git am -3
Learn more about email & git

[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.
View this thread in the archives