From 874c84ad4ede5cc207fde520420c26c353f7df08 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 28 Sep 2023 23:01:33 +0400 Subject: [PATCH] Fix file reference refresh in story forward. --- Telegram/SourceFiles/apiwrap.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index 441653784..31b478af9 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -2435,7 +2435,13 @@ void ApiWrap::refreshFileReference( }; v::match(origin.data, [&](Data::FileOriginMessage data) { if (const auto item = _session->data().message(data)) { - if (item->isScheduled()) { + const auto media = item->media(); + const auto storyId = media ? media->storyId() : FullStoryId(); + if (storyId) { + request(MTPstories_GetStoriesByID( + _session->data().peer(storyId.peer)->input, + MTP_vector(1, MTP_int(storyId.story)))); + } else if (item->isScheduled()) { const auto &scheduled = _session->data().scheduledMessages(); const auto realId = scheduled.lookupId(item); request(MTPmessages_GetScheduledMessages(