2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 22:55:11 +00:00

Add group call settings box.

This commit is contained in:
John Preston
2020-11-28 19:18:51 +03:00
parent abb81c764e
commit 9e5006dd67
11 changed files with 369 additions and 219 deletions

View File

@@ -123,13 +123,17 @@ void GroupCall::applyUpdate(const MTPGroupCall &update) {
void GroupCall::applyCall(const MTPGroupCall &call, bool force) {
call.match([&](const MTPDgroupCall &data) {
const auto changed = (_version != data.vversion().v)
|| (_fullCount.current() != data.vparticipants_count().v);
|| (_fullCount.current() != data.vparticipants_count().v)
|| (_joinMuted != data.is_join_muted())
|| (_canChangeJoinMuted != data.is_can_change_join_muted());
if (!force && !changed) {
return;
} else if (!force && _version > data.vversion().v) {
reload();
return;
}
_joinMuted = data.is_join_muted();
_canChangeJoinMuted = data.is_can_change_join_muted();
_version = data.vversion().v;
_fullCount = data.vparticipants_count().v;
}, [&](const MTPDgroupCallDiscarded &data) {
@@ -275,4 +279,16 @@ void GroupCall::applyUpdateChecked(
applyParticipantsSlice(update.vparticipants().v, true);
}
void GroupCall::setJoinMutedLocally(bool muted) {
_joinMuted = muted;
}
bool GroupCall::joinMuted() const {
return _joinMuted;
}
bool GroupCall::canChangeJoinMuted() const {
return _canChangeJoinMuted;
}
} // namespace Data