Process entities from sent requests/updates

This commit is contained in:
Lonami Exo 2018-06-18 20:44:20 +02:00
parent fbf3bf119c
commit 262018959f
2 changed files with 7 additions and 2 deletions

View File

@ -160,6 +160,7 @@ class UpdateMethods(UserMethods):
# region Private methods
def _handle_update(self, update):
self.session.process_entities(update)
if isinstance(update, (types.Updates, types.UpdatesCombined)):
entities = {utils.get_peer_id(x): x for x in
itertools.chain(update.users, update.chats)}

View File

@ -25,10 +25,14 @@ class UserMethods(TelegramBaseClient):
if isinstance(future, list):
results = []
for f in future:
results.append(await f)
result = await f
self.session.process_entities(result)
results.append(result)
return results
else:
return await future
result = await future
self.session.process_entities(result)
return result
except (errors.ServerError, errors.RpcCallFailError) as e:
__log__.warning('Telegram is having internal issues %s: %s',
e.__class__.__name__, e)