Store self user in entity cache

This commit is contained in:
Lonami Exo
2023-04-06 13:58:26 +02:00
parent 97b0ba6707
commit 88bc6a46a6
5 changed files with 16 additions and 23 deletions

View File

@@ -380,8 +380,7 @@ class AuthMethods:
Returns the input user parameter.
"""
self._bot = bool(user.bot)
self._self_input_peer = utils.get_input_peer(user, allow_self=False)
self._mb_entity_cache.set_self_user(user.id, user.bot, user.access_hash)
self._authorized = True
state = await self(functions.updates.GetStateRequest())
@@ -531,8 +530,7 @@ class AuthMethods:
except errors.RPCError:
return False
self._bot = None
self._self_input_peer = None
self._mb_entity_cache.set_self_user(None, False, None)
self._authorized = False
await self.disconnect()