From b3c92ed3f4857c55009ce4eb9aafcf93ec765107 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 31 May 2021 18:00:41 +0400 Subject: [PATCH] Rejoin if the call started accepting video. --- .../SourceFiles/calls/group/calls_group_call.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Telegram/SourceFiles/calls/group/calls_group_call.cpp b/Telegram/SourceFiles/calls/group/calls_group_call.cpp index 4b88c44bdd..9456f65183 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_call.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_call.cpp @@ -555,6 +555,20 @@ void GroupCall::subscribeToReal(not_null real) { setScheduledDate(date); }, _lifetime); + // If we joined before you could start video and then you can, + // you have to rejoin so that the server knows your video params. + real->canStartVideoValue( + ) | rpl::combine_previous( + ) | rpl::start_with_next([=](bool could, bool can) { + if (could || !can) { + return; + } if (_joinState.action == JoinAction::None) { + rejoin(); + } else { + _joinState.nextActionPending = true; + } + }, _lifetime); + // Postpone creating video tracks, so that we know if Panel // supports OpenGL and we don't need ARGB32 frames at all. Ui::PostponeCall(this, [=] {