2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-02 23:55:12 +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

@@ -319,7 +319,7 @@ void MainWindow::setupIntro(Intro::EnterPoint point) {
fixOrder();
}
void MainWindow::setupMain() {
void MainWindow::setupMain(MsgId singlePeerShowAtMsgId) {
Expects(account().sessionExists());
const auto animated = _intro
@@ -338,7 +338,10 @@ void MainWindow::setupMain() {
clearWidgets();
_main = std::move(created);
if (const auto peer = singlePeer()) {
_main->controller()->showPeerHistory(peer);
_main->controller()->showPeerHistory(
peer,
Window::SectionShow::Way::ClearStack,
singlePeerShowAtMsgId);
}
if (_passcodeLock) {
_main->hide();
@@ -859,8 +862,8 @@ MainWindow::~MainWindow() {
namespace App {
MainWindow *wnd() {
return (Core::IsAppLaunched() && Core::App().activeWindow())
? Core::App().activeWindow()->widget().get()
return (Core::IsAppLaunched() && Core::App().primaryWindow())
? Core::App().primaryWindow()->widget().get()
: nullptr;
}