From 262018959f2df199311e2d3d525415fe388d855a Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Mon, 18 Jun 2018 20:44:20 +0200 Subject: [PATCH] Process entities from sent requests/updates --- telethon/client/updates.py | 1 + telethon/client/users.py | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/telethon/client/updates.py b/telethon/client/updates.py index b47fba3a..077f98f0 100644 --- a/telethon/client/updates.py +++ b/telethon/client/updates.py @@ -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)} diff --git a/telethon/client/users.py b/telethon/client/users.py index bc647488..bd85e0c5 100644 --- a/telethon/client/users.py +++ b/telethon/client/users.py @@ -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)