Skip to content

Commit

Permalink
Merge pull request #1688 from nextcloud/screenshare-participant-name-…
Browse files Browse the repository at this point in the history
…follow-up

Update screensharing user name when receiving nick signaling message
  • Loading branch information
SystemKeeper committed Jun 26, 2024
2 parents f54bc44 + 65d98ad commit 218e64b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions NextcloudTalk/CallViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ @interface CallViewController () <NCCallControllerDelegate, UICollectionViewDele
NSMutableArray *_screenPeersInCall;
NSMutableDictionary *_videoRenderersDict; // peerIdentifier -> renderer
NSMutableDictionary *_screenRenderersDict; // peerId -> renderer
NSString *_presentedScreenPeerId;
NCCallController *_callController;
ChatViewController *_chatViewController;
UINavigationController *_chatNavigationController;
Expand Down Expand Up @@ -2134,6 +2135,12 @@ - (void)callController:(NCCallController *)callController didReceiveNick:(NSStri
[self updatePeer:peer block:^(CallParticipantViewCell *cell) {
[cell setDisplayName:nick];
}];

if ([peer.peerId isEqualToString:_presentedScreenPeerId]) {
dispatch_async(dispatch_get_main_queue(), ^{
[self->_screenshareLabel setText:nick];
});
}
}

- (void)callController:(NCCallController *)callController didReceiveUnshareScreenFromPeer:(NCPeerConnection *)peer
Expand Down Expand Up @@ -2252,6 +2259,7 @@ - (void)showScreenOfPeer:(NCPeerConnection *)peer
peerDisplayName = NSLocalizedString(@"Guest", nil);
}

self->_presentedScreenPeerId = peer.peerId;
[self->_screenshareLabel setText:peerDisplayName];
[self->_screensharingView bringSubviewToFront:self->_screenshareLabelContainer];

Expand All @@ -2274,6 +2282,7 @@ - (void)removeScreensharingOfPeer:(NCPeerConnection *)peer
dispatch_async(dispatch_get_main_queue(), ^{
RTCMTLVideoView *screenRenderer = [self->_screenRenderersDict objectForKey:peer.peerId];
NCPeerConnection *screenPeerConnection = [self screenPeerConnectionForPeerId:peer.peerId];
self->_presentedScreenPeerId = nil;
[self->_screenRenderersDict removeObjectForKey:peer.peerId];
[self updatePeer:screenPeerConnection block:^(CallParticipantViewCell *cell) {
[cell setScreenShared:NO];
Expand Down

0 comments on commit 218e64b

Please sign in to comment.