From ab7358916597cc79329ae8b85ce0eeed1199b9b6 Mon Sep 17 00:00:00 2001 From: levlam Date: Sat, 12 Dec 2020 14:47:56 +0300 Subject: [PATCH] Implement GroupCallManager::on_receive_group_call_version. --- td/telegram/GroupCallManager.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/td/telegram/GroupCallManager.cpp b/td/telegram/GroupCallManager.cpp index d3262855c..cc46ce948 100644 --- a/td/telegram/GroupCallManager.cpp +++ b/td/telegram/GroupCallManager.cpp @@ -770,6 +770,9 @@ void GroupCallManager::process_pending_group_call_participants_updates(InputGrou auto &pending_updates = participants_it->second->pending_updates_; auto group_call = get_group_call(input_group_call_id); CHECK(group_call != nullptr && group_call->is_inited); + if (group_call->version == -1) { + return; + } int32 diff = 0; while (!pending_updates.empty()) { @@ -1461,7 +1464,26 @@ InputGroupCallId GroupCallManager::update_group_call(const tl_object_ptris_inited); + if (group_call->version == -1) { + return; + } + if (version <= group_call->version) { + return; + } + + // found a gap + auto &group_call_participants = group_call_participants_[input_group_call_id]; + if (group_call_participants == nullptr) { + group_call_participants = make_unique(); + } + group_call_participants->pending_updates_[version]; // reserve place for updates + sync_participants_timeout_.add_timeout_in(group_call->group_call_id.get(), 1.0); } void GroupCallManager::on_user_speaking_in_group_call(GroupCallId group_call_id, UserId user_id, int32 date,