Improve get_real_participant_order.

This commit is contained in:
levlam 2021-03-15 18:58:31 +03:00
parent 7987912230
commit b0aa14c031
2 changed files with 6 additions and 6 deletions

View File

@ -1527,15 +1527,15 @@ void GroupCallManager::on_sync_group_call_participants_failed(InputGroupCallId i
sync_participants_timeout_.add_timeout_in(group_call->group_call_id.get(), 1.0);
}
GroupCallParticipantOrder GroupCallManager::get_real_participant_order(const GroupCallParticipant &participant,
GroupCallParticipantOrder min_order) const {
GroupCallParticipantOrder GroupCallManager::get_real_participant_order(
const GroupCallParticipant &participant, const GroupCallParticipantOrder &min_order) const {
auto real_order = participant.get_real_order();
if (real_order < min_order && participant.is_self) {
return min_order;
}
if (real_order >= min_order) {
return real_order;
}
if (participant.is_self) {
return min_order;
}
return GroupCallParticipantOrder();
}

View File

@ -181,7 +181,7 @@ class GroupCallManager : public Actor {
void on_sync_group_call_participants_failed(InputGroupCallId input_group_call_id);
GroupCallParticipantOrder get_real_participant_order(const GroupCallParticipant &participant,
GroupCallParticipantOrder min_order) const;
const GroupCallParticipantOrder &min_order) const;
void process_group_call_participants(InputGroupCallId group_call_id,
vector<tl_object_ptr<telegram_api::groupCallParticipant>> &&participants,