This commit is contained in:
@@ -19,11 +19,11 @@ async def search_recipients(_, info, text: str, limit: int = 50, offset: int = 0
|
||||
author_id = info.context["author_id"]
|
||||
|
||||
existed_chats = await redis.execute("SMEMBERS", f"/chats_by_author/{author_id}")
|
||||
if isinstance(existed_chats, str):
|
||||
chats_list = list(json.loads(existed_chats))
|
||||
for chat_id in chats_list[offset : (offset + limit)]:
|
||||
members_ids = await redis.execute("GET", f"/chats/{chat_id}/members")
|
||||
if isinstance(members_ids, list):
|
||||
if isinstance(existed_chats, set):
|
||||
chats_list = list(existed_chats)
|
||||
for chat_id in chats_list[offset: (offset + limit)]:
|
||||
members_ids = await redis.execute("SMEMBERS", f"/chats/{chat_id}/members")
|
||||
if isinstance(members_ids, set):
|
||||
for member_id in members_ids:
|
||||
author = CacheStorage.authors_by_id.get(member_id)
|
||||
if author:
|
||||
@@ -36,6 +36,7 @@ async def search_recipients(_, info, text: str, limit: int = 50, offset: int = 0
|
||||
return {"members": list(result), "error": None}
|
||||
|
||||
|
||||
|
||||
@query.field("search_messages")
|
||||
@login_required
|
||||
async def search_messages(
|
||||
|
Reference in New Issue
Block a user