Skip to content

Commit

Permalink
Don't store participants for being left group calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
levlam committed Oct 17, 2024
1 parent 672f837 commit 16a12cd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion td/telegram/GroupCallManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1573,7 +1573,7 @@ bool GroupCallManager::need_group_call_participants(InputGroupCallId input_group

bool GroupCallManager::need_group_call_participants(InputGroupCallId input_group_call_id,
const GroupCall *group_call) const {
if (group_call == nullptr || !group_call->is_inited || !group_call->is_active) {
if (group_call == nullptr || !group_call->is_inited || !group_call->is_active || group_call->is_being_left) {
return false;
}
if (group_call->is_joined || group_call->need_rejoin || group_call->is_being_joined) {
Expand Down Expand Up @@ -1742,6 +1742,9 @@ void GroupCallManager::on_update_group_call_participants(
LOG(ERROR) << "Receive invalid " << to_string(group_call_participant);
continue;
}
if (participant.is_self && group_call != nullptr && group_call->is_being_left) {
continue;
}
if (participant.joined_date == 0) {
if (group_call == nullptr || version > group_call->leave_version) {
diff--;
Expand Down Expand Up @@ -4090,6 +4093,7 @@ void GroupCallManager::leave_group_call(GroupCallId group_call_id, Promise<Unit>
}
group_call->is_being_left = true;
group_call->need_rejoin = false;
try_clear_group_call_participants(input_group_call_id);
send_update_group_call(group_call, "leave_group_call");

process_group_call_after_join_requests(input_group_call_id, "leave_group_call 3");
Expand Down

0 comments on commit 16a12cd

Please sign in to comment.