diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 289438e5b..b0e5f8d2a 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -842,7 +842,9 @@ HistoryWidget::HistoryWidget( }); } else { fastShowAtEnd(action.history); - if (cancelReply(lastKeyboardUsed) && !action.clearDraft) { + if (!_justMarkingAsRead + && cancelReply(lastKeyboardUsed) + && !action.clearDraft) { saveCloudDraft(); } } @@ -3963,7 +3965,12 @@ void HistoryWidget::send(Api::SendOptions options) { ignoreSlowmodeCountdown)) { return; } + + // Just a flag not to drop reply info if we're not sending anything. + _justMarkingAsRead = !HasSendText(_field) + && message.webPage.url.isEmpty(); session().api().sendMessage(std::move(message)); + _justMarkingAsRead = false; clearFieldText(); if (_preview) { diff --git a/Telegram/SourceFiles/history/history_widget.h b/Telegram/SourceFiles/history/history_widget.h index 450985010..ebc1a04c8 100644 --- a/Telegram/SourceFiles/history/history_widget.h +++ b/Telegram/SourceFiles/history/history_widget.h @@ -812,6 +812,7 @@ private: int _itemsRevealHeight = 0; bool _sponsoredMessagesStateKnown = false; + bool _justMarkingAsRead = false; object_ptr _topShadow; bool _inGrab = false;