| 715 | } |
| 716 | |
| 717 | void Instance::handleGroupCallUpdate( |
| 718 | not_null<Main::Session*> session, |
| 719 | const MTPUpdate &update) { |
| 720 | if (const auto i = _streams.find(session); i != end(_streams)) { |
| 721 | for (auto j = begin(i->second); j != end(i->second);) { |
| 722 | if (const auto strong = j->get()) { |
| 723 | update.match([&](const MTPDupdateGroupCall &data) { |
| 724 | strong->handlePossibleCreateOrJoinResponse(data); |
| 725 | strong->handleUpdate(update); |
| 726 | }, [&](const MTPDupdateGroupCallConnection &data) { |
| 727 | strong->handlePossibleCreateOrJoinResponse(data); |
| 728 | }, [&](const MTPDupdateGroupCallMessage &data) { |
| 729 | strong->handleIncomingMessage(data); |
| 730 | }, [&](const MTPDupdateGroupCallEncryptedMessage &data) { |
| 731 | strong->handleIncomingMessage(data); |
| 732 | }, [&](const MTPDupdateDeleteGroupCallMessages &data) { |
| 733 | strong->handleDeleteMessages(data); |
| 734 | }, [&](const MTPDupdateMessageID &data) { |
| 735 | strong->handleMessageSent(data); |
| 736 | }, [&](const MTPDupdateGroupCallParticipants &data) { |
| 737 | strong->handleUpdate(update); |
| 738 | }, [&](const MTPDupdateGroupCallChainBlocks &data) { |
| 739 | strong->handleUpdate(update); |
| 740 | }, [](const auto &) { |
| 741 | }); |
| 742 | ++j; |
| 743 | } else { |
| 744 | j = i->second.erase(j); |
| 745 | } |
| 746 | } |
| 747 | } |
| 748 | |
| 749 | const auto groupCall = _currentGroupCall |
| 750 | ? _currentGroupCall.get() |
| 751 | : _startingGroupCall.get(); |
| 752 | if (groupCall && (&groupCall->peer()->session() == session)) { |
| 753 | update.match([&](const MTPDupdateGroupCall &data) { |
| 754 | groupCall->handlePossibleCreateOrJoinResponse(data); |
| 755 | }, [&](const MTPDupdateGroupCallConnection &data) { |
| 756 | groupCall->handlePossibleCreateOrJoinResponse(data); |
| 757 | }, [&](const MTPDupdateGroupCallMessage &data) { |
| 758 | groupCall->handleIncomingMessage(data); |
| 759 | }, [&](const MTPDupdateGroupCallEncryptedMessage &data) { |
| 760 | groupCall->handleIncomingMessage(data); |
| 761 | }, [&](const MTPDupdateDeleteGroupCallMessages &data) { |
| 762 | groupCall->handleDeleteMessages(data); |
| 763 | }, [&](const MTPDupdateMessageID &data) { |
| 764 | groupCall->handleMessageSent(data); |
| 765 | }, [](const auto &) { |
| 766 | }); |
| 767 | } |
| 768 | |
| 769 | if (update.type() == mtpc_updateGroupCallConnection |
| 770 | || update.type() == mtpc_updateGroupCallMessage |
| 771 | || update.type() == mtpc_updateGroupCallEncryptedMessage |
| 772 | || update.type() == mtpc_updateDeleteGroupCallMessages |
| 773 | || update.type() == mtpc_updateMessageID) { |
| 774 | return; |
nothing calls this directly
no test coverage detected