Skip to content

Commit

Permalink
Merge pull request #1784 from nextcloud/code-style-fixup-external-sig…
Browse files Browse the repository at this point in the history
…naling

Code style changes in external signaling controller
  • Loading branch information
Ivansss authored Sep 2, 2024
2 parents 20eaa4c + 78508c5 commit 5d30fe3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions NextcloudTalk/NCExternalSignalingController.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ @interface NCExternalSignalingController () <NSURLSessionWebSocketDelegate>
@property (nonatomic, strong) NSMutableArray *messagesWithCompletionBlocks;
@property (nonatomic, assign) NSInteger reconnectInterval;
@property (nonatomic, strong) NSTimer *reconnectTimer;
@property (nonatomic, assign) BOOL sessionChanged;
@property (nonatomic, assign) NSInteger disconnectTime;

@end
Expand Down Expand Up @@ -340,9 +339,11 @@ - (void)helloResponseReceived:(NSDictionary *)messageDict

NSDictionary *helloDict = [messageDict objectForKey:@"hello"];
_resumeId = [helloDict objectForKey:@"resumeid"];

NSString *newSessionId = [helloDict objectForKey:@"sessionid"];
_sessionChanged = _sessionId && ![_sessionId isEqualToString:newSessionId];
BOOL sessionChanged = _sessionId && ![_sessionId isEqualToString:newSessionId];
_sessionId = newSessionId;

NSArray *serverFeatures = [[helloDict objectForKey:@"server"] objectForKey:@"features"];
for (NSString *feature in serverFeatures) {
if ([feature isEqualToString:@"mcu"]) {
Expand All @@ -365,11 +366,11 @@ - (void)helloResponseReceived:(NSDictionary *)messageDict
});

// Re-join if user was in a room
if (_currentRoom && _sessionChanged) {
_sessionChanged = NO;
if (_currentRoom && sessionChanged) {
sessionChanged = NO;
[self.delegate externalSignalingControllerWillRejoinCall:self];

[[NCRoomsManager sharedInstance] rejoinRoom:_currentRoom completionBlock:^(NSString * _Nullable, NCRoom * _Nullable, NSError * _Nullable, NSInteger, NSString * _Nullable) {
[[NCRoomsManager sharedInstance] rejoinRoom:_currentRoom completionBlock:^(NSString * _Nullable sessionId, NCRoom * _Nullable room, NSError * _Nullable error, NSInteger statusCode, NSString * _Nullable statusReason) {
[self.delegate externalSignalingControllerShouldRejoinCall:self];
}];
}
Expand Down

0 comments on commit 5d30fe3

Please sign in to comment.