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

Method onClick

Telegram/SourceFiles/data/data_peer.cpp:282–303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280}
281
282void 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
305PeerData::PeerData(not_null<Data::Session*> owner, PeerId id)
306: id(id)

Callers 4

onClickImplMethod · 0.45
SendBotCallbackDataFunction · 0.45
ActivateBotCommandFunction · 0.45
fillMethod · 0.45

Calls 7

windowsMethod · 0.80
frontMethod · 0.80
showPeerMethod · 0.80
getMethod · 0.45
sessionMethod · 0.45
emptyMethod · 0.45
activateMethod · 0.45

Tested by

no test coverage detected