Improve GroupCallParticipant updating.
This commit is contained in:
parent
4a3375e617
commit
bfcc7d17c4
@ -1188,7 +1188,6 @@ int GroupCallManager::process_group_call_participant(InputGroupCallId input_grou
|
||||
return -1;
|
||||
}
|
||||
|
||||
LOG(INFO) << "Edit " << old_participant;
|
||||
if (participant.joined_date < old_participant.joined_date) {
|
||||
LOG(ERROR) << "Join date of " << participant.user_id << " in " << input_group_call_id << " decreased from "
|
||||
<< old_participant.joined_date << " to " << participant.joined_date;
|
||||
@ -1205,16 +1204,13 @@ int GroupCallManager::process_group_call_participant(InputGroupCallId input_grou
|
||||
}
|
||||
participant.is_just_joined = false;
|
||||
|
||||
if (old_participant != participant) {
|
||||
LOG(INFO) << "Update " << old_participant << " to " << participant;
|
||||
bool need_update =
|
||||
old_participant.order != 0 || participant.order != 0 || old_participant.source != participant.source;
|
||||
old_participant = std::move(participant);
|
||||
if (need_update) {
|
||||
send_update_group_call_participant(input_group_call_id, old_participant);
|
||||
}
|
||||
on_participant_speaking_in_group_call(input_group_call_id, old_participant);
|
||||
LOG(INFO) << "Edit " << old_participant << " to " << participant;
|
||||
if (old_participant != participant &&
|
||||
(old_participant.order != 0 || participant.order != 0 || old_participant.source != participant.source)) {
|
||||
send_update_group_call_participant(input_group_call_id, participant);
|
||||
}
|
||||
on_participant_speaking_in_group_call(input_group_call_id, participant);
|
||||
old_participant = std::move(participant);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -43,9 +43,7 @@ td_api::object_ptr<td_api::groupCallParticipant> GroupCallParticipant::get_group
|
||||
|
||||
bool operator==(const GroupCallParticipant &lhs, const GroupCallParticipant &rhs) {
|
||||
return lhs.user_id == rhs.user_id && lhs.source == rhs.source && lhs.is_muted == rhs.is_muted &&
|
||||
lhs.can_self_unmute == rhs.can_self_unmute && lhs.joined_date == rhs.joined_date &&
|
||||
max(lhs.active_date, lhs.local_active_date) == max(rhs.active_date, rhs.local_active_date) &&
|
||||
lhs.is_speaking == rhs.is_speaking && lhs.order == rhs.order;
|
||||
lhs.can_self_unmute == rhs.can_self_unmute && lhs.is_speaking == rhs.is_speaking && lhs.order == rhs.order;
|
||||
}
|
||||
|
||||
bool operator!=(const GroupCallParticipant &lhs, const GroupCallParticipant &rhs) {
|
||||
|
Loading…
Reference in New Issue
Block a user