From 8c3120b5cc4fd4085449ad56a0384dd2320af534 Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 11 Dec 2020 22:52:53 +0300 Subject: [PATCH] Process group call participants returned in getGroupCall. --- td/telegram/GroupCallManager.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/td/telegram/GroupCallManager.cpp b/td/telegram/GroupCallManager.cpp index 58881d4f8..55a4b17e7 100644 --- a/td/telegram/GroupCallManager.cpp +++ b/td/telegram/GroupCallManager.cpp @@ -606,6 +606,16 @@ void GroupCallManager::finish_get_group_call(InputGroupCallId input_group_call_i if (update_group_call(result.ok()->call_, ChannelId()) != input_group_call_id) { LOG(ERROR) << "Expected " << input_group_call_id << ", but received " << to_string(result.ok()); result = Status::Error(500, "Receive another group call"); + } else { + process_group_call_participants(input_group_call_id, std::move(result.ok_ref()->participants_), false); + + auto participants_it = group_call_participants_.find(input_group_call_id); + if (participants_it != group_call_participants_.end()) { + CHECK(participants_it->second != nullptr); + if (participants_it->second->next_offset.empty()) { + participants_it->second->next_offset = std::move(result.ok_ref()->participants_next_offset_); + } + } } } @@ -651,9 +661,11 @@ void GroupCallManager::on_get_group_call_participants( if (is_load) { // TODO use count auto participants_it = group_call_participants_.find(input_group_call_id); - if (participants_it != group_call_participants_.end() && participants_it->second->next_offset == offset) { + if (participants_it != group_call_participants_.end()) { CHECK(participants_it->second != nullptr); - participants_it->second->next_offset = std::move(participants->next_offset_); + if (participants_it->second->next_offset == offset) { + participants_it->second->next_offset = std::move(participants->next_offset_); + } } } }