From b8cf00a0b2d4086312b7a929b2f2cda57b161697 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 30 May 2023 09:44:31 +0400 Subject: [PATCH] Fix replying to stories with voice messages. --- Telegram/SourceFiles/data/data_histories.cpp | 18 +++++++++--------- .../controls/history_view_compose_controls.cpp | 2 +- .../media/stories/media_stories_controller.cpp | 2 ++ 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Telegram/SourceFiles/data/data_histories.cpp b/Telegram/SourceFiles/data/data_histories.cpp index d69b11ce4..4ca3cb635 100644 --- a/Telegram/SourceFiles/data/data_histories.cpp +++ b/Telegram/SourceFiles/data/data_histories.cpp @@ -35,15 +35,7 @@ constexpr auto kReadRequestTimeout = 3 * crl::time(1000); MTPInputReplyTo ReplyToForMTP( not_null owner, FullReplyTo replyTo) { - if (replyTo.msgId || replyTo.topicRootId) { - using Flag = MTPDinputReplyToMessage::Flag; - return MTP_inputReplyToMessage( - (replyTo.topicRootId - ? MTP_flags(Flag::f_top_msg_id) - : MTP_flags(0)), - MTP_int(replyTo.msgId ? replyTo.msgId : replyTo.topicRootId), - MTP_int(replyTo.topicRootId)); - } else if (replyTo.storyId) { + if (replyTo.storyId) { if (const auto peer = owner->peerLoaded(replyTo.storyId.peer)) { if (const auto user = peer->asUser()) { return MTP_inputReplyToStory( @@ -51,6 +43,14 @@ MTPInputReplyTo ReplyToForMTP( MTP_int(replyTo.storyId.story)); } } + } else if (replyTo.msgId || replyTo.topicRootId) { + using Flag = MTPDinputReplyToMessage::Flag; + return MTP_inputReplyToMessage( + (replyTo.topicRootId + ? MTP_flags(Flag::f_top_msg_id) + : MTP_flags(0)), + MTP_int(replyTo.msgId ? replyTo.msgId : replyTo.topicRootId), + MTP_int(replyTo.topicRootId)); } return MTPInputReplyTo(); } diff --git a/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp b/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp index 29f1736ae..23a57dc06 100644 --- a/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp +++ b/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp @@ -2274,7 +2274,7 @@ void ComposeControls::initVoiceRecordBar() { return std::nullopt; }(); if (error) { - _show->showBox(Ui::MakeInformBox(*error)); + _show->showToast(*error); return true; } else if (_showSlowmodeError && _showSlowmodeError()) { return true; diff --git a/Telegram/SourceFiles/media/stories/media_stories_controller.cpp b/Telegram/SourceFiles/media/stories/media_stories_controller.cpp index 650ef7af2..35d2f3709 100644 --- a/Telegram/SourceFiles/media/stories/media_stories_controller.cpp +++ b/Telegram/SourceFiles/media/stories/media_stories_controller.cpp @@ -421,6 +421,8 @@ void Controller::show( } stories.loadAround(storyId); + list.user->updateFull(); + if (_contentFaded) { togglePaused(true); }