From b217bf37845c5a4b92a2f45613697dd0f5a0ddb3 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Wed, 29 May 2019 09:49:50 +0200 Subject: [PATCH] Refactor ChatPhoto to accommodate L100 changes --- .../client/types/user_and_chats/chat_photo.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/pyrogram/client/types/user_and_chats/chat_photo.py b/pyrogram/client/types/user_and_chats/chat_photo.py index 08e43138..1885eff2 100644 --- a/pyrogram/client/types/user_and_chats/chat_photo.py +++ b/pyrogram/client/types/user_and_chats/chat_photo.py @@ -50,31 +50,24 @@ class ChatPhoto(PyrogramType): self.big_file_id = big_file_id @staticmethod - def _parse(client, chat_photo: types.UserProfilePhoto or types.ChatPhoto): + def _parse(client, chat_photo: types.UserProfilePhoto or types.ChatPhoto, peer_id: int): if not isinstance(chat_photo, (types.UserProfilePhoto, types.ChatPhoto)): return None - if not isinstance(chat_photo.photo_small, types.FileLocation): - return None - - if not isinstance(chat_photo.photo_big, types.FileLocation): - return None - - photo_id = getattr(chat_photo, "photo_id", 0) loc_small = chat_photo.photo_small loc_big = chat_photo.photo_big return ChatPhoto( small_file_id=encode( pack( - "