| 1624 | } |
| 1625 | |
| 1626 | void 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 | |
| 1650 | void Application::windowActivated(not_null<Window::Controller*> window) { |
| 1651 | const auto was = _lastActiveWindow; |
no test coverage detected