diff --git a/NextcloudTalk/NCExternalSignalingController.m b/NextcloudTalk/NCExternalSignalingController.m index e5548150..53b17d17 100644 --- a/NextcloudTalk/NCExternalSignalingController.m +++ b/NextcloudTalk/NCExternalSignalingController.m @@ -159,11 +159,7 @@ static NSTimeInterval kWebSocketTimeoutInterval = 15; [self executeAllCompletionBlocksWithError]; - [_webSocket cancel]; - _webSocket = nil; - _helloResponseReceived = NO; - [_helloMessage ignoreCompletionBlock]; - _helloMessage = nil; + [self resetWebSocket]; [self setReconnectionTimer]; } @@ -180,13 +176,20 @@ static NSTimeInterval kWebSocketTimeoutInterval = 15; { dispatch_async(dispatch_get_main_queue(), ^{ [self invalidateReconnectionTimer]; - [self->_webSocket cancel]; - self->_webSocket = nil; - self->_helloResponseReceived = NO; - self->_disconnected = YES; + [self resetWebSocket]; }); } +- (void)resetWebSocket +{ + [_webSocket cancel]; + _webSocket = nil; + _helloResponseReceived = NO; + [_helloMessage ignoreCompletionBlock]; + _helloMessage = nil; + _disconnected = YES; +} + - (void)setReconnectionTimer { [self invalidateReconnectionTimer];