2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Track three-state muted value.

This commit is contained in:
John Preston
2020-11-28 10:18:46 +03:00
parent c8dd486410
commit d18b29efb8
4 changed files with 59 additions and 18 deletions

View File

@@ -19,6 +19,12 @@ class GroupInstanceImpl;
namespace Calls {
enum class MuteState {
Active,
Muted,
ForceMuted,
};
class GroupCall final : public base::has_weak_ptr {
public:
class Delegate {
@@ -49,11 +55,11 @@ public:
void handleUpdate(const MTPGroupCall &call);
void handleUpdate(const MTPDupdateGroupCallParticipants &data);
void setMuted(bool mute);
[[nodiscard]] bool muted() const {
void setMuted(MuteState mute);
[[nodiscard]] MuteState muted() const {
return _muted.current();
}
[[nodiscard]] rpl::producer<bool> mutedValue() const {
[[nodiscard]] rpl::producer<MuteState> mutedValue() const {
return _muted.value();
}
[[nodiscard]] bool joined() const {
@@ -113,7 +119,7 @@ private:
MTP::Sender _api;
rpl::variable<State> _state = State::Creating;
rpl::variable<bool> _muted = true;
rpl::variable<MuteState> _muted = MuteState::Muted;
bool _acceptFields = false;
uint64 _id = 0;