2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Apply volume_by_admin flag in voice chats.

This commit is contained in:
John Preston
2021-02-09 12:58:19 +04:00
parent d60a89f354
commit 39742d22d9
4 changed files with 18 additions and 2 deletions

View File

@@ -276,9 +276,14 @@ void GroupCall::applyParticipantsSlice(
&& ((was ? was->speaking : false)
|| (!amInCall
&& (lastActive + speakingAfterActive > now)));
const auto volume = (was && data.is_min())
const auto volume = (was
&& !was->applyVolumeFromMin
&& data.is_min())
? was->volume
: data.vvolume().value_or(Calls::Group::kDefaultVolume);
const auto applyVolumeFromMin = (was && data.is_min())
? was->applyVolumeFromMin
: (data.is_min() || data.is_volume_by_admin());
const auto mutedByMe = (was && data.is_min())
? was->mutedByMe
: data.is_muted_by_you();
@@ -290,6 +295,7 @@ void GroupCall::applyParticipantsSlice(
.lastActive = lastActive,
.ssrc = uint32(data.vsource().v),
.volume = volume,
.applyVolumeFromMin = applyVolumeFromMin,
.speaking = canSelfUnmute && (was ? was->speaking : false),
.muted = data.is_muted(),
.mutedByMe = mutedByMe,