filter announces by identity hash

This commit is contained in:
liamcottle
2024-09-17 16:35:38 +12:00
parent 5d8bf9fd55
commit 39d9b5bfc5

View File

@@ -775,6 +775,7 @@ class ReticulumMeshChat:
# get query params
aspect = request.query.get("aspect", None)
identity_hash = request.query.get("identity_hash", None)
limit = request.query.get("limit", None)
# build announces database query
@@ -784,6 +785,10 @@ class ReticulumMeshChat:
if aspect is not None:
query = query.where(database.Announce.aspect == aspect)
# filter by provided identity hash
if identity_hash is not None:
query = query.where(database.Announce.identity_hash == identity_hash)
# limit results
if limit is not None:
query = query.limit(limit)