diff --git a/Telegram/SourceFiles/dialogs/dialogs_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_widget.cpp index be5110084..ffe53fece 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_widget.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_widget.cpp @@ -265,15 +265,25 @@ Widget::Widget( : row.message.fullId.msg; if (row.newWindow && controller->canShowSeparateWindow(peer)) { const auto active = controller->activeChatCurrent(); - if (const auto history = active.history()) { - if (history->peer == peer) { + const auto fromActive = active.history() + ? (active.history()->peer == peer) + : false; + const auto toSeparate = [=] { + Core::App().ensureSeparateWindowForPeer( + peer, + showAtMsgId); + }; + if (fromActive) { + controller->window().preventOrInvoke([=] { controller->content()->ui_showPeerHistory( 0, Window::SectionShow::Way::ClearStack, 0); - } + toSeparate(); + }); + } else { + toSeparate(); } - Core::App().ensureSeparateWindowForPeer(peer, showAtMsgId); } else { controller->content()->choosePeer(peer->id, showAtMsgId); } diff --git a/Telegram/SourceFiles/history/view/controls/history_view_voice_record_bar.cpp b/Telegram/SourceFiles/history/view/controls/history_view_voice_record_bar.cpp index 3c4b0c4e2..cddd95f0d 100644 --- a/Telegram/SourceFiles/history/view/controls/history_view_voice_record_bar.cpp +++ b/Telegram/SourceFiles/history/view/controls/history_view_voice_record_bar.cpp @@ -1416,7 +1416,6 @@ void VoiceRecordBar::hideFast() { hide(); _lock->hide(); _level->hide(); - stopRecording(StopType::Cancel); } void VoiceRecordBar::stopRecording(StopType type) { @@ -1543,7 +1542,10 @@ void VoiceRecordBar::hideAnimated() { return; } _lockShowing = false; - visibilityAnimate(false, [=] { hideFast(); }); + visibilityAnimate(false, [=] { + hideFast(); + stopRecording(StopType::Cancel); + }); } void VoiceRecordBar::finishAnimating() { @@ -1677,6 +1679,7 @@ void VoiceRecordBar::showDiscardBox( auto sure = [=, callback = std::move(callback)](Fn &&close) { if (animated == anim::type::instant) { hideFast(); + stopRecording(StopType::Cancel); } else { hideAnimated(); }