This commit is contained in:
parent
9d1a4e90c9
commit
b2040099a8
|
@ -53,9 +53,9 @@ async def load_messages(
|
||||||
async def load_chats(_, info, limit: int = 50, offset: int = 0) -> Dict[str, Union[List[Dict[str, Any]], None]]:
|
async def load_chats(_, info, limit: int = 50, offset: int = 0) -> Dict[str, Union[List[Dict[str, Any]], None]]:
|
||||||
"""load :limit chats of current user with :offset"""
|
"""load :limit chats of current user with :offset"""
|
||||||
author_id = info.context.get("author_id")
|
author_id = info.context.get("author_id")
|
||||||
|
chats = []
|
||||||
if author_id:
|
if author_id:
|
||||||
cids = await redis.execute("SMEMBERS", f"chats_by_author/{author_id}")
|
cids = await redis.execute("SMEMBERS", f"chats_by_author/{author_id}")
|
||||||
chats = []
|
|
||||||
if cids:
|
if cids:
|
||||||
members_online = (await redis.execute("SMEMBERS", "authors-online")) or []
|
members_online = (await redis.execute("SMEMBERS", "authors-online")) or []
|
||||||
cids = list(cids)[offset : (offset + limit)]
|
cids = list(cids)[offset : (offset + limit)]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user