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

Method showHistoryInDifferentWindow

Telegram/SourceFiles/mainwidget.cpp:1329–1372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1327}
1328
1329bool MainWidget::showHistoryInDifferentWindow(
1330 PeerId peerId,
1331 const SectionShow &params,
1332 MsgId showAtMsgId) {
1333 if (!peerId) {
1334 // In case we don't have dialogs, we can't clear section stack.
1335 return !_dialogs;
1336 }
1337 const auto peer = session().data().peer(peerId);
1338 if (const auto separateChat = _controller->windowId().chat()) {
1339 if (const auto history = separateChat->asHistory()) {
1340 if (history->peer == peer) {
1341 return false;
1342 }
1343 }
1344 }
1345 const auto window = Core::App().windowForShowingHistory(peer);
1346 if (window == &_controller->window()) {
1347 return false;
1348 } else if (window) {
1349 window->sessionController()->showPeerHistory(
1350 peerId,
1351 params,
1352 showAtMsgId);
1353 window->activate();
1354 return true;
1355 } else if (windowId().hasChatsList()) {
1356 return false;
1357 }
1358 const auto account = not_null(&session().account());
1359 auto primary = Core::App().separateWindowFor(account);
1360 if (!primary) {
1361 Core::App().domain().activate(account);
1362 primary = Core::App().separateWindowFor(account);
1363 }
1364 if (primary && &primary->account() == account) {
1365 primary->sessionController()->showPeerHistory(
1366 peerId,
1367 params,
1368 showAtMsgId);
1369 primary->activate();
1370 }
1371 return true;
1372}
1373
1374void MainWidget::showHistory(
1375 PeerId peerId,

Callers

nothing calls this directly

Calls 13

AppClass · 0.85
asHistoryMethod · 0.80
hasChatsListMethod · 0.80
separateWindowForMethod · 0.80
peerMethod · 0.45
dataMethod · 0.45
chatMethod · 0.45
windowIdMethod · 0.45
windowMethod · 0.45
showPeerHistoryMethod · 0.45
sessionControllerMethod · 0.45

Tested by

no test coverage detected