diff --git a/Telegram/SourceFiles/calls/calls.style b/Telegram/SourceFiles/calls/calls.style index 18052cd98e..4f4d90b336 100644 --- a/Telegram/SourceFiles/calls/calls.style +++ b/Telegram/SourceFiles/calls/calls.style @@ -24,8 +24,8 @@ CallSignalBars { inactiveOpacity: double; } -callWidthMin: 372px; -callHeightMin: 440px; +callWidthMin: 380px; +callHeightMin: 520px; callWidth: 720px; callHeight: 540px; @@ -532,7 +532,7 @@ callErrorToast: Toast(defaultToast) { } groupCallWidth: 380px; -groupCallHeight: 580px; +groupCallHeight: 520px; groupCallWidthRtmp: 720px; groupCallWidthRtmpMin: 240px; groupCallHeightRtmp: 580px; diff --git a/Telegram/SourceFiles/calls/calls_call.cpp b/Telegram/SourceFiles/calls/calls_call.cpp index 3a5246fec7..7455ea2be6 100644 --- a/Telegram/SourceFiles/calls/calls_call.cpp +++ b/Telegram/SourceFiles/calls/calls_call.cpp @@ -1033,6 +1033,8 @@ void Call::createAndStartController(const MTPDphoneCall &call) { return; } + _conferenceSupported = call.is_conference_supported(); + const auto &protocol = call.vprotocol().c_phoneCallProtocol(); const auto &serverConfig = _user->session().serverConfig(); diff --git a/Telegram/SourceFiles/calls/calls_call.h b/Telegram/SourceFiles/calls/calls_call.h index 3ba17518a2..41ee5dd9ad 100644 --- a/Telegram/SourceFiles/calls/calls_call.h +++ b/Telegram/SourceFiles/calls/calls_call.h @@ -170,6 +170,10 @@ public: return _errors.events(); } + [[nodiscard]] rpl::producer confereceSupportedValue() const { + return _conferenceSupported.value(); + } + enum class RemoteAudioState { Muted, Active, @@ -322,6 +326,7 @@ private: MTP::Sender _api; Type _type = Type::Outgoing; rpl::variable _state = State::Starting; + rpl::variable _conferenceSupported = false; rpl::variable _remoteAudioState = RemoteAudioState::Active; rpl::variable _remoteVideoState; diff --git a/Telegram/SourceFiles/calls/calls_panel.cpp b/Telegram/SourceFiles/calls/calls_panel.cpp index 6197ee5bec..02cb070432 100644 --- a/Telegram/SourceFiles/calls/calls_panel.cpp +++ b/Telegram/SourceFiles/calls/calls_panel.cpp @@ -690,6 +690,16 @@ void Panel::reinitWithCall(Call *call) { _user = _call->user(); + _call->confereceSupportedValue( + ) | rpl::start_with_next([=](bool supported) { + _conferenceSupported = supported; + _addPeople->toggle(_conferenceSupported + && (_call->state() != State::WaitingUserConfirmation), + window()->isHidden() ? anim::type::instant : anim::type::normal); + + updateHangupGeometry(); + }, _callLifetime); + auto remoteMuted = _call->remoteAudioStateValue( ) | rpl::map(rpl::mappers::_1 == Call::RemoteAudioState::Muted); rpl::duplicate( @@ -1321,7 +1331,8 @@ void Panel::updateHangupGeometry() { const auto buttonWidth = st::callCancel.button.width; const auto cancelWidth = buttonWidth * (1. - hangupProgress); const auto cancelLeft = (widget()->width() - buttonWidth) / 2 - - ((isBusy || incomingWaiting) ? buttonWidth : 0); + - ((isBusy || incomingWaiting) ? buttonWidth : 0) + + ((isWaitingUser || _conferenceSupported) ? 0 : (buttonWidth / 2)); _cancel->moveToLeft(cancelLeft, _buttonsTop); _decline->moveToLeft(cancelLeft, _buttonsTop); @@ -1413,12 +1424,11 @@ void Panel::stateChanged(State state) { } _camera->setVisible(!_startVideo); + const auto windowHidden = window()->isHidden(); const auto toggleButton = [&](auto &&button, bool visible) { button->toggle( visible, - window()->isHidden() - ? anim::type::instant - : anim::type::normal); + (windowHidden ? anim::type::instant : anim::type::normal)); }; const auto incomingWaiting = _call->isIncomingWaiting(); if (incomingWaiting) { @@ -1430,7 +1440,7 @@ void Panel::stateChanged(State state) { toggleButton( _screencast, !(isBusy || isWaitingUser || incomingWaiting)); - toggleButton(_addPeople, !isWaitingUser); + toggleButton(_addPeople, !isWaitingUser && _conferenceSupported); const auto hangupShown = !_decline->toggled() && !_cancel->toggled(); if (_hangupShown != hangupShown) { diff --git a/Telegram/SourceFiles/calls/calls_panel.h b/Telegram/SourceFiles/calls/calls_panel.h index 539342d2bc..b07e0ac7ed 100644 --- a/Telegram/SourceFiles/calls/calls_panel.h +++ b/Telegram/SourceFiles/calls/calls_panel.h @@ -200,6 +200,7 @@ private: object_ptr> _decline; object_ptr> _cancel; bool _hangupShown = false; + bool _conferenceSupported = false; bool _outgoingPreviewInBody = false; std::optional _answerHangupRedialState; Ui::Animations::Simple _hangupShownProgress;