diff --git a/src/CurrentCallVC.mm b/src/CurrentCallVC.mm index 71297e6ba579fe024b1a1abd654fe9520b83f834..4f8fd9227dea3f7454d956dc5096054600600507 100644 --- a/src/CurrentCallVC.mm +++ b/src/CurrentCallVC.mm @@ -239,7 +239,7 @@ CVPixelBufferRef pixelBufferPreview; return; } if ([self isCurrentCall: confId]) { - [self updateConference: confId]; + [self updateConference]; } }); //monitor for updated call state @@ -385,8 +385,9 @@ CVPixelBufferRef pixelBufferPreview; participantsOverlays = [[NSMutableDictionary alloc] init]; } --(void)updateConference:(QString)confId +-(void)updateConference { + auto confId = [self getcallID]; if (confId.isEmpty()) { [self removeConferenceLayout]; return; @@ -400,6 +401,7 @@ CVPixelBufferRef pixelBufferPreview; [self removeConferenceLayout]; return; } + NSMutableArray* participantUrs = [[NSMutableArray alloc] init]; for (auto participant: participants) { ConferenceParticipant conferenceParticipant; conferenceParticipant.x = participant["x"].toFloat(); @@ -407,6 +409,7 @@ CVPixelBufferRef pixelBufferPreview; conferenceParticipant.width = participant["w"].toFloat(); conferenceParticipant.hight = participant["h"].toFloat(); conferenceParticipant.uri = participant["uri"].toNSString(); + [participantUrs addObject:participant["uri"].toNSString()]; conferenceParticipant.active = participant["active"] == "true"; conferenceParticipant.isLocal = false; conferenceParticipant.bestName = participant["uri"].toNSString(); @@ -433,6 +436,13 @@ CVPixelBufferRef pixelBufferPreview; [overlay updateViewWithParticipant: conferenceParticipant]; } } + auto keys = [participantsOverlays allKeys]; + for (auto key : keys) { + if (![participantUrs containsObject:key]) { + [participantsOverlays[key] removeFromSuperview]; + participantsOverlays[key] = nil; + } + } } -(void) updateCall @@ -465,7 +475,7 @@ CVPixelBufferRef pixelBufferPreview; [recordOnOffButton setHidden:!confUid_.isEmpty()]; [holdOnOffButton setHidden:!confUid_.isEmpty()]; [movableBaseForView setHidden:!confUid_.isEmpty()]; - [self updateConference: confUid_]; + [self updateConference]; [timeSpentLabel setStringValue:callModel->getFormattedCallDuration(callUid_).toNSString()]; if (refreshDurationTimer == nil)