From 470b67f55758bb927b531357c31086b8c4c027b4 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 30 Aug 2019 15:42:01 +0300 Subject: [PATCH] Refresh file reference from scheduled messages. --- 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 45eb27c35..fbd3384a2 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(