Improve logging and make get_dialogs use iterators more

This commit is contained in:
Tulir Asokan
2019-08-06 19:58:15 +03:00
parent ee08458df1
commit 43d16474c2
5 changed files with 17 additions and 14 deletions
@@ -316,11 +316,10 @@ class ProvisioningAPI(AuthAPI):
return err
if not user.is_bot:
chats = await user.get_dialogs()
return web.json_response([{
"id": get_peer_id(chat),
"title": chat.title,
} for chat in chats])
} async for chat in user.get_dialogs()])
else:
return web.json_response([{
"id": get_peer_id(chat.peer),