| 280 | } |
| 281 | |
| 282 | void PeerClickHandler::onClick(ClickContext context) const { |
| 283 | if (context.button != Qt::LeftButton) { |
| 284 | return; |
| 285 | } |
| 286 | const auto my = context.other.value<ClickHandlerContext>(); |
| 287 | const auto window = [&]() -> Window::SessionController* { |
| 288 | if (const auto controller = my.sessionWindow.get()) { |
| 289 | return controller; |
| 290 | } |
| 291 | const auto &windows = _peer->session().windows(); |
| 292 | if (windows.empty()) { |
| 293 | _peer->session().domain().activate(&_peer->session().account()); |
| 294 | if (windows.empty()) { |
| 295 | return nullptr; |
| 296 | } |
| 297 | } |
| 298 | return windows.front(); |
| 299 | }(); |
| 300 | if (window) { |
| 301 | window->showPeer(_peer); |
| 302 | } |
| 303 | } |
| 304 | |
| 305 | PeerData::PeerData(not_null<Data::Session*> owner, PeerId id) |
| 306 | : id(id) |
no test coverage detected