From 3a8237f03a25681fb1137d7686bb74801ec2323b Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 23 Apr 2023 19:23:41 +0400 Subject: [PATCH] Fix staying _replaceMedia button after media edit. --- Telegram/SourceFiles/history/history_widget.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 12e07fc76..cd07b0767 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -2131,6 +2131,7 @@ void HistoryWidget::showHistory( _saveEditMsgRequestId = 0; _processingReplyItem = _replyEditMsg = nullptr; _processingReplyId = _editMsgId = _replyToId = 0; + _canReplaceMedia = false; _photoEditMedia = nullptr; updateReplaceMediaButton(); _previewData = nullptr; @@ -2466,6 +2467,9 @@ void HistoryWidget::registerDraftSource() { void HistoryWidget::setEditMsgId(MsgId msgId) { unregisterDraftSources(); _editMsgId = msgId; + if (!msgId) { + _canReplaceMedia = false; + } if (_history) { refreshSendAsToggle(); orderWidgets();