2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Parse and serialize video parameters.

This commit is contained in:
John Preston
2021-04-15 17:55:32 +04:00
parent a41b7b62ac
commit a6f379a17a
8 changed files with 251 additions and 9 deletions

View File

@@ -343,7 +343,7 @@ void GroupCall::applyLocalUpdate(
const MTPDupdateGroupCallParticipants &update) {
applyParticipantsSlice(
update.vparticipants().v,
ApplySliceSource::UpdateReceived);
ApplySliceSource::UpdateConstructed);
}
void GroupCall::applyEnqueuedUpdate(const MTPUpdate &update) {
@@ -529,8 +529,21 @@ void GroupCall::applyParticipantsSlice(
&& (!was || was->onlyMinLoaded);
const auto raisedHandRating
= data.vraise_hand_rating().value_or_empty();
const auto hasVideoParamsInformation = (sliceSource
!= ApplySliceSource::UpdateConstructed);
const auto value = Participant{
.peer = participantPeer,
.videoParams = (hasVideoParamsInformation
? Calls::ParseVideoParams(
(data.vparams()
? data.vparams()->c_dataJSON().vdata().v
: QByteArray()),
(i != end(_participants)
? i->videoParams
: nullptr))
: (i != end(_participants))
? i->videoParams
: nullptr),
.date = data.vdate().v,
.lastActive = lastActive,
.raisedHandRating = raisedHandRating,