Fix non-aggressive get_participants and inverted condition

This commit is contained in:
Lonami Exo 2018-03-03 15:07:49 +01:00
parent 0e0e7f1c9e
commit 57f50889b0

View File

@ -1090,6 +1090,9 @@ class TelegramClient(TelegramBareClient):
if requests[0].offset > limit:
break
if len(requests) == 1:
results = (self(requests[0]),)
else:
results = self(*requests)
for i in reversed(range(len(requests))):
participants = results[i]
@ -1101,9 +1104,9 @@ class TelegramClient(TelegramBareClient):
if len(all_participants) < limit:
all_participants[user.id] = user
if limit < float('inf'):
values = all_participants.values()
else:
values = itertools.islice(all_participants.values(), limit)
else:
values = all_participants.values()
users = UserList(values)
users.total = total