2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Fixed opening of non-primary windows while recording voice message.

This commit is contained in:
23rd
2022-06-24 03:56:18 +03:00
parent 0fbd7d1a3b
commit 75d8e8ba7d
2 changed files with 19 additions and 6 deletions

View File

@@ -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);
}