Handle members slice loaded.

This commit is contained in:
John Preston 2021-04-30 20:15:39 +04:00
parent ba1dade4b0
commit d9aa660253
2 changed files with 21 additions and 2 deletions

View File

@ -501,6 +501,25 @@ void GroupCall::subscribeToReal(not_null<Data::GroupCall*> 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) {

View File

@ -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();
}
}