diff --git a/Telegram/SourceFiles/calls/group/calls_group_call.cpp b/Telegram/SourceFiles/calls/group/calls_group_call.cpp index cdc22d9e4..ae1cddad0 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_call.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_call.cpp @@ -501,6 +501,25 @@ void GroupCall::subscribeToReal(not_null real) { const auto emptyEndpoint = std::string(); + real->participantsSliceAdded( + ) | rpl::start_with_next([=] { + const auto &participants = real->participants(); + for (const auto &participant : participants) { + const auto camera = participant.cameraEndpoint(); + const auto screen = participant.screenEndpoint(); + if (!camera.empty() + && _activeVideoEndpoints.emplace(camera).second + && _incomingVideoEndpoints.contains(camera)) { + _streamsVideoUpdated.fire({ camera, true }); + } + if (!screen.empty() + && _activeVideoEndpoints.emplace(screen).second + && _incomingVideoEndpoints.contains(screen)) { + _streamsVideoUpdated.fire({ screen, true }); + } + } + }, _lifetime); + using Update = Data::GroupCall::ParticipantUpdate; real->participantUpdated( ) | rpl::start_with_next([=](const Update &data) { diff --git a/Telegram/SourceFiles/calls/group/calls_group_members.cpp b/Telegram/SourceFiles/calls/group/calls_group_members.cpp index 59c1fe66c..c1b766da8 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_members.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_members.cpp @@ -1175,8 +1175,8 @@ void MembersController::setupListChangeViewers() { } _largeEndpoint = largeEndpoint; if (const auto participant = findParticipant(_largeEndpoint)) { - if (participant->cameraEndpoint() == _largeEndpoint) { - if (const auto row = findRow(participant->peer)) { + if (const auto row = findRow(participant->peer)) { + if (row->videoTrackEndpoint() == _largeEndpoint) { row->clearVideoTrack(); } }