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

Improved Controller::invokeForSessionController for separate windows.

This commit is contained in:
23rd
2024-07-30 13:51:07 +03:00
parent caef698e54
commit a32b781e49

View File

@@ -499,6 +499,15 @@ void Controller::invokeForSessionController(
if (separateSession) {
return callback(separateSession);
}
const auto accountWindow = account
? Core::App().separateWindowFor(not_null(account))
: nullptr;
const auto accountSession = accountWindow
? accountWindow->sessionController()
: nullptr;
if (accountSession) {
return callback(accountSession);
}
_id.account->domain().activate(std::move(account));
if (_sessionController) {
callback(_sessionController.get());