diff --git a/NextcloudTalk/CallViewController.m b/NextcloudTalk/CallViewController.m index 4beac94f..35c2c5d0 100644 --- a/NextcloudTalk/CallViewController.m +++ b/NextcloudTalk/CallViewController.m @@ -1769,7 +1769,7 @@ typedef void (^UpdateCallParticipantViewCellBlock)(CallParticipantViewCell *cell }); } -- (void)callController:(NCCallController *)callController isSwitchingToCall:(NSString *)token +- (void)callController:(NCCallController *)callController isSwitchingToCall:(NSString *)token withAudioEnabled:(BOOL)audioEnabled andVideoEnabled:(BOOL)videoEnabled { [self setCallState:CallStateSwitchingToAnotherRoom]; @@ -1794,8 +1794,8 @@ typedef void (^UpdateCallParticipantViewCellBlock)(CallParticipantViewCell *cell // Asign new room as current room self->_room = [NCRoom roomWithDictionary:roomDict andAccountId:activeAccount.accountId]; // Save current audio and video state - self->_audioDisabledAtStart = !self->_callController.isAudioEnabled; - self->_videoDisabledAtStart = !self->_callController.isVideoEnabled; + self->_audioDisabledAtStart = !audioEnabled; + self->_videoDisabledAtStart = !videoEnabled; // Forget current call controller self->_callController = nil; // Join new room diff --git a/NextcloudTalk/NCCallController.h b/NextcloudTalk/NCCallController.h index 84eb9921..e7edbaaf 100644 --- a/NextcloudTalk/NCCallController.h +++ b/NextcloudTalk/NCCallController.h @@ -52,7 +52,7 @@ - (void)callControllerIsReconnectingCall:(NCCallController *)callController; - (void)callControllerWantsToHangUpCall:(NCCallController *)callController; - (void)callControllerDidChangeRecording:(NCCallController *)callController; -- (void)callController:(NCCallController *)callController isSwitchingToCall:(NSString *)token; +- (void)callController:(NCCallController *)callController isSwitchingToCall:(NSString *)token withAudioEnabled:(BOOL)audioEnabled andVideoEnabled:(BOOL)videoEnabled; @end diff --git a/NextcloudTalk/NCCallController.m b/NextcloudTalk/NCCallController.m index e84624ff..655037c7 100644 --- a/NextcloudTalk/NCCallController.m +++ b/NextcloudTalk/NCCallController.m @@ -262,9 +262,11 @@ static NSString * const kNCVideoTrackKind = @"video"; - (void)willSwitchToCall:(NSString *)token { NSLog(@"willSwitchToCall"); + BOOL isAudioEnabled = [self isAudioEnabled]; + BOOL isVideoEnabled = [self isVideoEnabled]; _userInCall = 0; [self stopCallController]; - [self.delegate callController:self isSwitchingToCall:token]; + [self.delegate callController:self isSwitchingToCall:token withAudioEnabled:isAudioEnabled andVideoEnabled:isVideoEnabled]; }