Skip to content

Commit

Permalink
Fix story forward_from
Browse files Browse the repository at this point in the history
  • Loading branch information
KurimuzonAkuma committed Dec 9, 2023
1 parent 5168393 commit 2ad31a6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pyrogram/types/messages_and_media/story.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,14 +262,14 @@ async def _parse(

forward_header = story.fwd_from # type: raw.types.StoryFwdHeader

if forward_header and forward_header.from_id:
raw_peer_id = utils.get_raw_peer_id(forward_header.from_id)
peer_id = utils.get_peer_id(forward_header.from_id)
if forward_header:
fwd_raw_peer_id = utils.get_raw_peer_id(forward_header.from_peer)
fwd_peer_id = utils.get_peer_id(forward_header.from_peer)

if peer_id > 0:
forward_from = types.User._parse(client, users[raw_peer_id])
if fwd_peer_id > 0:
forward_from = types.User._parse(client, users[fwd_raw_peer_id])
else:
forward_from_chat = types.Chat._parse_channel_chat(client, chats[raw_peer_id])
forward_from_chat = types.Chat._parse_channel_chat(client, chats[fwd_raw_peer_id])
forward_from_story_id = forward_header.story_id

if story.views:
Expand Down

0 comments on commit 2ad31a6

Please sign in to comment.