From 5f26e92f5cf8509d8a1f3774a1eb8602ee87f2d7 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 8 Sep 2019 21:26:17 +0300 Subject: [PATCH] Fix scheduled messages from ShareBox. Fixes #6497. --- Telegram/SourceFiles/history/history_message.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/history/history_message.cpp b/Telegram/SourceFiles/history/history_message.cpp index 28dd1118f..7e95ed92b 100644 --- a/Telegram/SourceFiles/history/history_message.cpp +++ b/Telegram/SourceFiles/history/history_message.cpp @@ -277,6 +277,9 @@ void FastShareMessage(not_null item) { : MTPmessages_ForwardMessages::Flag(0)) | (options.silent ? MTPmessages_ForwardMessages::Flag::f_silent + : MTPmessages_ForwardMessages::Flag(0)) + | (options.scheduled + ? MTPmessages_ForwardMessages::Flag::f_schedule_date : MTPmessages_ForwardMessages::Flag(0)); auto msgIds = QVector(); msgIds.reserve(data->msgIds.size()); @@ -295,6 +298,7 @@ void FastShareMessage(not_null item) { if (!comment.text.isEmpty()) { auto message = ApiWrap::MessageToSend(history); message.textWithTags = comment; + message.action.options = options; message.action.clearDraft = false; history->session().api().sendMessage(std::move(message)); } @@ -305,7 +309,7 @@ void FastShareMessage(not_null item) { MTP_vector(msgIds), MTP_vector(generateRandom()), peer->input, - MTP_int(0)), + MTP_int(options.scheduled)), rpcDone(base::duplicate(doneCallback)), nullptr, 0,