mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-10 19:46:36 +03:00
Don't unnecessarily refetch the sender twice
This commit is contained in:
parent
299b090cde
commit
db29e9b7ef
|
@ -46,6 +46,9 @@ class SenderGetter(abc.ABC):
|
||||||
# cached information, they may use the property instead.
|
# cached information, they may use the property instead.
|
||||||
if (self._sender is None or getattr(self._sender, 'min', None)) \
|
if (self._sender is None or getattr(self._sender, 'min', None)) \
|
||||||
and await self.get_input_sender():
|
and await self.get_input_sender():
|
||||||
|
# self.get_input_sender may refresh in which case the sender may no longer be min
|
||||||
|
# However it could still incur a cost so the cheap check is done twice instead.
|
||||||
|
if self._sender is None or getattr(self._sender, 'min', None):
|
||||||
try:
|
try:
|
||||||
self._sender =\
|
self._sender =\
|
||||||
await self._client.get_entity(self._input_sender)
|
await self._client.get_entity(self._input_sender)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user