| 4660 | } |
| 4661 | |
| 4662 | void 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 | |
| 4694 | void Session::applyUpdate(const MTPDupdateChatParticipants &update) { |
| 4695 | const auto chatId = update.vparticipants().match([](const auto &update) { |
no test coverage detected