storage: Add a thread_id filter to history_get:

rel 457
This commit is contained in:
Goffi 2025-05-06 00:34:01 +02:00
commit b2e64a9f03

View file

@ -665,6 +665,8 @@ class Storage:
stmt = stmt.where(History.uid == filters["id"])
if "origin_id" in filters:
stmt = stmt.where(History.origin_id == filters["origin_id"])
if "thread_id" in filters:
stmt = stmt.where(Thread.thread_id == filters["thread_id"])
if limit is not None:
stmt = stmt.limit(limit)
@ -692,7 +694,7 @@ class Storage:
if "thread" in data["extra"]:
thread = Thread(
thread_id=data["extra"]["thread"],
parent_id=data["extra"].get["thread_parent"],
parent_id=data["extra"].get("thread_parent"),
)
else:
thread = None