~sircmpwn/lists.sr.ht

efa0c307a1b592acfa9b92eae18ca2409d502f4d — Siva Mahadevan 6 months ago 3d16202 0.38.0
Add is:thread & is:reply filters

Also, fix bug where 'in_reply_to' never gets set.

Closes https://todo.sr.ht/~sircmpwn/lists.sr.ht/82.
2 files changed, 3 insertions(+), 0 deletions(-)

M listssrht/blueprints/archives.py
M listssrht/process.py
M listssrht/blueprints/archives.py => listssrht/blueprints/archives.py +2 -0
@@ 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),

M listssrht/process.py => listssrht/process.py +1 -0
@@ 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: