From fef1f80570030d5e69442a29be1250d3c3561792 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 16 Apr 2021 20:03:58 +0400 Subject: [PATCH] Disable video preview in Settings when in group call. --- Telegram/SourceFiles/settings/settings_calls.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/settings/settings_calls.cpp b/Telegram/SourceFiles/settings/settings_calls.cpp index 3a6b277c03..189f2bbc51 100644 --- a/Telegram/SourceFiles/settings/settings_calls.cpp +++ b/Telegram/SourceFiles/settings/settings_calls.cpp @@ -154,7 +154,9 @@ void Calls::setupContent() { track->renderNextFrame( ) | rpl::start_with_next([=] { const auto size = track->frameSize(); - if (size.isEmpty() || Core::App().calls().currentCall()) { + if (size.isEmpty() + || Core::App().calls().currentCall() + || Core::App().calls().currentGroupCall()) { return; } const auto width = bubbleWrap->width(); @@ -166,9 +168,13 @@ void Calls::setupContent() { bubbleWrap->update(); }, bubbleWrap->lifetime()); - Core::App().calls().currentCallValue( - ) | rpl::start_with_next([=](::Calls::Call *value) { - if (value) { + using namespace rpl::mappers; + rpl::combine( + Core::App().calls().currentCallValue(), + Core::App().calls().currentGroupCallValue(), + _1 || _2 + ) | rpl::start_with_next([=](bool has) { + if (has) { track->setState(VideoState::Inactive); bubbleWrap->resize(bubbleWrap->width(), 0); } else {