core (memory/sqla): add id filter in history_get

This commit is contained in:
Goffi 2023-11-28 17:26:45 +01:00
commit 191d06126e

View file

@ -616,6 +616,8 @@ class Storage:
if filters["last_stanza_id"] is not True or limit != 1:
raise ValueError("Unexpected values for last_stanza_id filter")
stmt = stmt.where(History.stanza_id.is_not(None))
if "id" in filters:
stmt = stmt.where(History.uid == filters["id"])
if "origin_id" in filters:
stmt = stmt.where(History.origin_id == filters["origin_id"])