Skip to content

Commit

Permalink
Handle all given updates, avoid short circuit (#1162)
Browse files Browse the repository at this point in the history
  • Loading branch information
kai3341 committed Dec 12, 2022
1 parent 73554b9 commit a76269d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pyrogram/client.py
Expand Up @@ -485,7 +485,10 @@ async def fetch_peers(self, peers: List[Union[raw.types.User, raw.types.Chat, ra

async def handle_updates(self, updates):
if isinstance(updates, (raw.types.Updates, raw.types.UpdatesCombined)):
is_min = (await self.fetch_peers(updates.users)) or (await self.fetch_peers(updates.chats))
is_min = any((
await self.fetch_peers(updates.users),
await self.fetch_peers(updates.chats),
))

users = {u.id: u for u in updates.users}
chats = {c.id: c for c in updates.chats}
Expand Down

0 comments on commit a76269d

Please sign in to comment.