MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / ensureSeparateWindowFor

Method ensureSeparateWindowFor

Telegram/SourceFiles/core/application.cpp:1409–1439  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1407}
1408
1409Window::Controller *Application::ensureSeparateWindowFor(
1410 Window::SeparateId id,
1411 MsgId showAtMsgId) {
1412 const auto activate = [&](not_null<Window::Controller*> window) {
1413 window->activate();
1414 return window;
1415 };
1416 if (const auto existing = separateWindowFor(id)) {
1417 if (id.thread
1418 && id.type == Window::SeparateType::Chat
1419 && !passcodeLocked()) {
1420 existing->sessionController()->showThread(
1421 id.thread,
1422 showAtMsgId,
1423 Window::SectionShow::Way::ClearStack);
1424 }
1425 return activate(existing);
1426 }
1427
1428 const auto result = _windows.emplace(
1429 id,
1430 std::make_unique<Window::Controller>(id, showAtMsgId)
1431 ).first->second.get();
1432 processCreatedWindow(result);
1433 if (passcodeLocked()) {
1434 result->setupPasscodeLock();
1435 }
1436 result->firstShow();
1437 result->finishFirstShow();
1438 return activate(result);
1439}
1440
1441Window::Controller *Application::windowFor(Window::SeparateId id) const {
1442 if (const auto separate = separateWindowFor(id)) {

Callers 10

FillFunction · 0.80
WindowForThreadFunction · 0.80
showInNewWindowMethod · 0.80
ShowForwardMessagesBoxFunction · 0.80
ResolveWindowDefaultFunction · 0.80
addActivatedMethod · 0.80
RefreshDockMenuFunction · 0.80
rebuildMethod · 0.80

Calls 8

showThreadMethod · 0.80
emplaceMethod · 0.80
activateMethod · 0.45
sessionControllerMethod · 0.45
getMethod · 0.45
setupPasscodeLockMethod · 0.45
firstShowMethod · 0.45
finishFirstShowMethod · 0.45

Tested by

no test coverage detected