Fix broken Chat parsing for user/bot chats

This commit is contained in:
Dan 2020-11-06 10:55:51 +01:00
parent e850530a9b
commit 6027ee867f

View File

@ -225,14 +225,7 @@ class Chat(Object):
@staticmethod
def _parse(client, message: raw.types.Message or raw.types.MessageService, users: dict, chats: dict) -> "Chat":
if isinstance(message.peer_id, raw.types.PeerUser):
return Chat._parse_user_chat(
client,
users[
message.peer_id.user_id
if message.out
else utils.get_raw_peer_id(message.from_id)
]
)
return Chat._parse_user_chat(client, users[message.peer_id.user_id])
if isinstance(message.peer_id, raw.types.PeerChat):
return Chat._parse_chat_chat(client, chats[message.peer_id.chat_id])