From 39d9b5bfc54db871877d6314cd47b582a24d3a00 Mon Sep 17 00:00:00 2001 From: liamcottle Date: Tue, 17 Sep 2024 16:35:38 +1200 Subject: [PATCH] filter announces by identity hash --- meshchat.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/meshchat.py b/meshchat.py index 75f49ab..7141182 100644 --- a/meshchat.py +++ b/meshchat.py @@ -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)