2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Open specific chat only in one window.

This commit is contained in:
John Preston
2022-01-04 19:36:33 +03:00
parent 54247cd11b
commit 18e6e2da9e
16 changed files with 187 additions and 103 deletions

View File

@@ -227,15 +227,24 @@ Widget::Widget(
const auto openSearchResult = !controller->selectingPeer()
&& row.filteredRow;
if (const auto history = row.key.history()) {
const auto window = row.newWindow
? Core::App().ensureSeparateWindowForPeer(
history->peer)->sessionController()
: controller.get();
window->content()->choosePeer(
history->peer->id,
(controller->uniqueChatsInSearchResults()
? ShowAtUnreadMsgId
: row.message.fullId.msg));
const auto peer = history->peer;
const auto showAtMsgId = controller->uniqueChatsInSearchResults()
? ShowAtUnreadMsgId
: row.message.fullId.msg;
if (row.newWindow) {
const auto active = controller->activeChatCurrent();
if (const auto history = active.history()) {
if (history->peer == peer) {
controller->content()->ui_showPeerHistory(
0,
Window::SectionShow::Way::ClearStack,
0);
}
}
Core::App().ensureSeparateWindowForPeer(peer, showAtMsgId);
} else {
controller->content()->choosePeer(peer->id, showAtMsgId);
}
} else if (const auto folder = row.key.folder()) {
controller->openFolder(folder);
}