diff --git a/Telegram/SourceFiles/api/api_sending.cpp b/Telegram/SourceFiles/api/api_sending.cpp index 93f9e8fb4..917c6d002 100644 --- a/Telegram/SourceFiles/api/api_sending.cpp +++ b/Telegram/SourceFiles/api/api_sending.cpp @@ -392,6 +392,7 @@ void SendConfirmedFile( action.replyTo = file->to.replyTo; action.topicRootId = file->to.topicRootId; action.generateLocal = true; + action.replaceMediaOf = file->to.replaceMediaOf; session->api().sendAction(action); auto caption = TextWithEntities{ diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index 93d52ff6c..4231e5c9b 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -3055,7 +3055,7 @@ void ApiWrap::sharedMediaDone( } void ApiWrap::sendAction(const SendAction &action) { - if (!action.options.scheduled) { + if (!action.options.scheduled && !action.replaceMediaOf) { const auto topic = action.topicRootId ? action.history->peer->forumTopicFor(action.topicRootId) : nullptr; diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 3f67d2f40..d9a0ec902 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -853,7 +853,8 @@ HistoryWidget::HistoryWidget( const auto lastKeyboardUsed = lastForceReplyReplied(FullMsgId( action.history->peer->id, action.replyTo)); - if (action.options.scheduled) { + if (action.replaceMediaOf) { + } else if (action.options.scheduled) { cancelReply(lastKeyboardUsed); crl::on_main(this, [=, history = action.history] { controller->showSection(