| 38 | namespace { |
| 39 | |
| 40 | [[nodiscard]] MainWidget *CheckMainWidget(not_null<Main::Session*> session) { |
| 41 | if (const auto m = App::main()) { // multi good |
| 42 | if (&m->session() == session) { |
| 43 | return m; |
| 44 | } |
| 45 | } |
| 46 | if (&Core::App().domain().active() != &session->account()) { |
| 47 | Core::App().domain().activate(&session->account()); |
| 48 | } |
| 49 | if (const auto m = App::main()) { // multi good |
| 50 | if (&m->session() == session) { |
| 51 | return m; |
| 52 | } |
| 53 | } |
| 54 | return nullptr; |
| 55 | } |
| 56 | |
| 57 | } // namespace |
| 58 |