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

Method applyUpdate

Telegram/SourceFiles/data/data_session.cpp:4662–4692  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4660}
4661
4662void Session::applyUpdate(const MTPDupdateMessagePoll &update) {
4663 const auto updated = [&] {
4664 const auto poll = update.vpoll();
4665 const auto i = _polls.find(update.vpoll_id().v);
4666 return (i == end(_polls))
4667 ? nullptr
4668 : poll
4669 ? processPoll(*poll).get()
4670 : i->second.get();
4671 }();
4672 if (updated && updated->applyResults(update.vresults())) {
4673 notifyPollUpdateDelayed(updated);
4674 }
4675 if (const auto tlPeer = update.vpeer()) {
4676 const auto peer = peerFromMTP(*tlPeer);
4677 if (const auto history = historyLoaded(peer)) {
4678 histories().requestDialogEntry(history);
4679 }
4680 } else if (updated) {
4681 if (const auto i = _pollViews.find(updated)
4682 ; i != _pollViews.end()) {
4683 for (const auto &view : i->second) {
4684 if (view->data()->hasUnreadPollVote()) {
4685 histories().requestDialogEntry(
4686 view->data()->history());
4687 break;
4688 }
4689 }
4690 }
4691 }
4692}
4693
4694void Session::applyUpdate(const MTPDupdateChatParticipants &update) {
4695 const auto chatId = update.vparticipants().match([](const auto &update) {

Callers 3

simpleIdsSliceMethod · 0.45
HistoryViewerFunction · 0.45
SharedMediaViewerFunction · 0.45

Calls 15

peerFromMTPFunction · 0.85
ApplyChatUpdateFunction · 0.85
ApplyChannelUpdateFunction · 0.85
applyResultsMethod · 0.80
requestDialogEntryMethod · 0.80
hasUnreadPollVoteMethod · 0.80
requestFullPeerMethod · 0.80
apiMethod · 0.80
asChatMethod · 0.80
asChannelMethod · 0.80
findMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected