From 5a57a8a498b1461d8aa041cc9adb7ec71eb88a33 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Sat, 11 Nov 2017 19:35:57 +0100 Subject: [PATCH] Fix message history failing if sender fwd from channel Closes #424 --- telethon/telegram_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telethon/telegram_client.py b/telethon/telegram_client.py index b1eec2b2..5a5d99ec 100644 --- a/telethon/telegram_client.py +++ b/telethon/telegram_client.py @@ -51,7 +51,7 @@ from .tl.types import ( InputUserSelf, UserProfilePhoto, ChatPhoto, UpdateMessageID, UpdateNewChannelMessage, UpdateNewMessage, UpdateShortSentMessage, PeerUser, InputPeerUser, InputPeerChat, InputPeerChannel, MessageEmpty, - ChatInvite, ChatInviteAlready + ChatInvite, ChatInviteAlready, PeerChannel ) from .tl.types.messages import DialogsSlice from .extensions import markdown @@ -558,7 +558,7 @@ class TelegramClient(TelegramBareClient): elif getattr(m, 'fwd_from', None): # .from_id is optional, so this is the sanest fallback. who = entities[utils.get_peer_id( - m.fwd_from.from_id or m.fwd_from.channel_id, + m.fwd_from.from_id or PeerChannel(m.fwd_from.channel_id), add_mark=True )] else: