Do not cache entities without access_hash

This commit is contained in:
bakatrouble 2019-03-01 21:23:53 +03:00
parent 8cc61f00ed
commit 85700b0ffc

View File

@ -762,6 +762,8 @@ class Client(Methods, BaseClient):
types.Chat, types.ChatForbidden,
types.Channel, types.ChannelForbidden]]):
for entity in entities:
if isinstance(entity, (types.User, types.Channel, types.ChannelForbidden)) and not entity.access_hash:
continue
self.session_storage.cache_peer(entity)
def download_worker(self):