diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index 45eb27c351..fbd3384a29 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -2997,7 +2997,13 @@ void ApiWrap::refreshFileReference( }; origin.data.match([&](Data::FileOriginMessage data) { if (const auto item = _session->data().message(data)) { - if (const auto channel = item->history()->peer->asChannel()) { + if (item->isScheduled()) { + const auto &scheduled = session().data().scheduledMessages(); + const auto realId = scheduled.lookupId(item); + request(MTPmessages_GetScheduledMessages( + item->history()->peer->input, + MTP_vector(1, MTP_int(realId)))); + } else if (const auto channel = item->history()->peer->asChannel()) { request(MTPchannels_GetMessages( channel->inputChannel, MTP_vector(