зеркало из https://github.com/nextcloud/talk-ios.git
Refactor joinRoomHelper
Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
This commit is contained in:
Родитель
3af96eb587
Коммит
71e888d40f
|
@ -182,28 +182,33 @@ static NSInteger kIgnoreStatusCode = 999;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!error) {
|
if (error) {
|
||||||
[NCUtils log:[NSString stringWithFormat:@"Joined room %@ in NC successfully.", token]];
|
if (block) {
|
||||||
NCExternalSignalingController *extSignalingController = [[NCSettingsController sharedInstance] externalSignalingControllerForAccountId:activeAccount.accountId];
|
// Failed to join room in NC.
|
||||||
if ([extSignalingController isEnabled]) {
|
block(nil, error, statusCode);
|
||||||
[NCUtils log:[NSString stringWithFormat:@"Trying to join room %@ in external signaling server...", token]];
|
|
||||||
[extSignalingController joinRoom:token withSessionId:sessionId withCompletionBlock:^(NSError *error) {
|
|
||||||
if (!error) {
|
|
||||||
[NCUtils log:[NSString stringWithFormat:@"Joined room %@ in external signaling server successfully.", token]];
|
|
||||||
block(sessionId, nil, 0);
|
|
||||||
} else if (block) {
|
|
||||||
[NCUtils log:[NSString stringWithFormat:@"Failed joining room %@ in external signaling server.", token]];
|
|
||||||
block(nil, error, statusCode);
|
|
||||||
}
|
|
||||||
}];
|
|
||||||
} else if (block) {
|
|
||||||
// Joined room in NC successfully and no external signaling server configured.
|
|
||||||
block(sessionId, nil, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
[NCUtils log:[NSString stringWithFormat:@"Joined room %@ in NC successfully.", token]];
|
||||||
|
NCExternalSignalingController *extSignalingController = [[NCSettingsController sharedInstance] externalSignalingControllerForAccountId:activeAccount.accountId];
|
||||||
|
|
||||||
|
if ([extSignalingController isEnabled]) {
|
||||||
|
[NCUtils log:[NSString stringWithFormat:@"Trying to join room %@ in external signaling server...", token]];
|
||||||
|
[extSignalingController joinRoom:token withSessionId:sessionId withCompletionBlock:^(NSError *error) {
|
||||||
|
if (!error) {
|
||||||
|
[NCUtils log:[NSString stringWithFormat:@"Joined room %@ in external signaling server successfully.", token]];
|
||||||
|
block(sessionId, nil, 0);
|
||||||
|
} else if (block) {
|
||||||
|
[NCUtils log:[NSString stringWithFormat:@"Failed joining room %@ in external signaling server.", token]];
|
||||||
|
block(nil, error, statusCode);
|
||||||
|
}
|
||||||
|
}];
|
||||||
} else if (block) {
|
} else if (block) {
|
||||||
// Failed to join room in NC.
|
// Joined room in NC successfully and no external signaling server configured.
|
||||||
block(nil, error, statusCode);
|
block(sessionId, nil, 0);
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче