Skip to content

Commit

Permalink
Fix re-joining a call
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Müller <[email protected]>
  • Loading branch information
SystemKeeper committed Aug 10, 2024
1 parent a09c4a0 commit acf639a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion NextcloudTalk/NCCallController.m
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ - (void)forceReconnect
self->_disableVideoAtStart = ![self isVideoEnabled];

if (self->_externalSignalingController) {
[self->_externalSignalingController forceReconnect];
[self->_externalSignalingController forceReconnectForRejoin];
} else {
[self rejoinCallUsingInternalSignaling];
}
Expand Down
2 changes: 1 addition & 1 deletion NextcloudTalk/NCExternalSignalingController.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ typedef void (^JoinRoomExternalSignalingCompletionBlock)(NSError *error);
- (void)connect;
- (void)forceConnect;
- (void)disconnect;
- (void)forceReconnect;
- (void)forceReconnectForRejoin;

@end
11 changes: 11 additions & 0 deletions NextcloudTalk/NCExternalSignalingController.m
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,17 @@ - (void)forceReconnect
});
}

- (void)forceReconnectForRejoin
{
// In case we force reconnect in order to rejoin the call again, we need to keep the currently joined room.
// In `helloResponseReceived` we determine that we were in a room and that the sessionId changed, in that case
// we trigger a re-join in `NCRoomsManager` which takes care of re-joining.
dispatch_async(dispatch_get_main_queue(), ^{
self->_resumeId = nil;
[self reconnect];
});
}

- (void)disconnect
{
[NCUtils log:[NSString stringWithFormat:@"Disconnecting from: %@", _serverUrl]];
Expand Down

0 comments on commit acf639a

Please sign in to comment.