From 2b74ad8b5f685212a9db705c8c75d5e0a59c3615 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 14 Apr 2025 11:41:26 +0400 Subject: [PATCH] Disable raised-hand state in confcalls. --- Telegram/SourceFiles/calls/group/calls_group_panel.cpp | 8 ++++++-- Telegram/SourceFiles/ui/controls/call_mute_button.cpp | 5 ++++- Telegram/SourceFiles/ui/controls/call_mute_button.h | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/calls/group/calls_group_panel.cpp b/Telegram/SourceFiles/calls/group/calls_group_panel.cpp index 4ef0118f04..a0157c3de0 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_panel.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_panel.cpp @@ -463,7 +463,9 @@ void Panel::initControls() { const auto oldState = _call->muted(); const auto newState = (oldState == MuteState::ForceMuted) - ? MuteState::RaisedHand + ? (_call->conference() + ? MuteState::ForceMuted + : MuteState::RaisedHand) : (oldState == MuteState::RaisedHand) ? MuteState::RaisedHand : (oldState == MuteState::Muted) @@ -763,7 +765,9 @@ void Panel::setupRealMuteButtonState(not_null real) { : state == GroupCall::InstanceState::Disconnected ? Type::Connecting : mute == MuteState::ForceMuted - ? Type::ForceMuted + ? (_call->conference() + ? Type::ConferenceForceMuted + : Type::ForceMuted) : mute == MuteState::RaisedHand ? Type::RaisedHand : mute == MuteState::Muted diff --git a/Telegram/SourceFiles/ui/controls/call_mute_button.cpp b/Telegram/SourceFiles/ui/controls/call_mute_button.cpp index b142eb7ea0..34f26507a1 100644 --- a/Telegram/SourceFiles/ui/controls/call_mute_button.cpp +++ b/Telegram/SourceFiles/ui/controls/call_mute_button.cpp @@ -75,7 +75,8 @@ constexpr auto kOverlapProgressRadialHide = 1.2; constexpr auto kRadialFinishArcShift = 1200; [[nodiscard]] CallMuteButtonType TypeForIcon(CallMuteButtonType type) { - return (type == CallMuteButtonType::Connecting) + return (type == CallMuteButtonType::Connecting + || type == CallMuteButtonType::ConferenceForceMuted) ? CallMuteButtonType::Muted : (type == CallMuteButtonType::RaisedHand) ? CallMuteButtonType::ForceMuted @@ -157,6 +158,7 @@ auto Colors() { const auto forceMutedTypes = { CallMuteButtonType::ForceMuted, CallMuteButtonType::RaisedHand, + CallMuteButtonType::ConferenceForceMuted, CallMuteButtonType::ScheduledCanStart, CallMuteButtonType::ScheduledNotify, CallMuteButtonType::ScheduledSilent, @@ -1040,6 +1042,7 @@ CallMuteButton::HandleMouseState CallMuteButton::HandleMouseStateFromType( case CallMuteButtonType::ScheduledCanStart: case CallMuteButtonType::ScheduledNotify: case CallMuteButtonType::ScheduledSilent: + case CallMuteButtonType::ConferenceForceMuted: case CallMuteButtonType::ForceMuted: case CallMuteButtonType::RaisedHand: return HandleMouseState::Enabled; diff --git a/Telegram/SourceFiles/ui/controls/call_mute_button.h b/Telegram/SourceFiles/ui/controls/call_mute_button.h index 455c944851..b61fd392d1 100644 --- a/Telegram/SourceFiles/ui/controls/call_mute_button.h +++ b/Telegram/SourceFiles/ui/controls/call_mute_button.h @@ -39,6 +39,7 @@ enum class CallMuteButtonType { Muted, ForceMuted, RaisedHand, + ConferenceForceMuted, ScheduledCanStart, ScheduledSilent, ScheduledNotify,