perf: reuse authorized chat snapshot when reading history
This commit is contained in:
+2
-2
@@ -268,13 +268,13 @@ async def send(request: Request, chat_id: str):
|
||||
async def history(request: Request, chat_id: str):
|
||||
user = await actor(request)
|
||||
cid = parse_uuid(chat_id)
|
||||
await run_io(service(request).get_chat, actor_id=user.id, chat_id=cid)
|
||||
chat = await run_io(service(request).get_chat, actor_id=user.id, chat_id=cid)
|
||||
limit, cursor = pagination(request)
|
||||
return response(
|
||||
await run_io(
|
||||
service(request).history,
|
||||
actor_id=user.id,
|
||||
chat_id=cid,
|
||||
chat=chat,
|
||||
limit=limit,
|
||||
cursor=cursor,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user