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

Method closeChatFromWindows

Telegram/SourceFiles/core/application.cpp:1626–1648  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1624}
1625
1626void Application::closeChatFromWindows(not_null<PeerData*> peer) {
1627 const auto closeOne = [&] {
1628 for (const auto &[id, window] : _windows) {
1629 if (id.thread && id.thread->peer() == peer) {
1630 closeWindow(window.get());
1631 return true;
1632 } else if (const auto controller = window->sessionController()) {
1633 if (controller->activeChatCurrent().peer() == peer) {
1634 controller->showByInitialId();
1635 }
1636 if (const auto forum = controller->shownForum().current()) {
1637 if (peer->forum() == forum) {
1638 controller->closeForum();
1639 }
1640 }
1641 }
1642 }
1643 return false;
1644 };
1645
1646 while (closeOne()) {
1647 }
1648}
1649
1650void Application::windowActivated(not_null<Window::Controller*> window) {
1651 const auto was = _lastActiveWindow;

Callers 5

deleteAndClearMethod · 0.80
DeleteChatBoxFunction · 0.80
deleteChannelMethod · 0.80
setFlagsMethod · 0.80
setFlagsMethod · 0.80

Calls 9

activeChatCurrentMethod · 0.80
showByInitialIdMethod · 0.80
shownForumMethod · 0.80
closeForumMethod · 0.80
peerMethod · 0.45
getMethod · 0.45
sessionControllerMethod · 0.45
currentMethod · 0.45
forumMethod · 0.45

Tested by

no test coverage detected