зеркало из 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;
|
||||
}
|
||||
|
||||
if (!error) {
|
||||
[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) {
|
||||
// Joined room in NC successfully and no external signaling server configured.
|
||||
block(sessionId, nil, 0);
|
||||
|
||||
if (error) {
|
||||
if (block) {
|
||||
// Failed to join room in NC.
|
||||
block(nil, error, statusCode);
|
||||
}
|
||||
|
||||
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) {
|
||||
// Failed to join room in NC.
|
||||
block(nil, error, statusCode);
|
||||
// Joined room in NC successfully and no external signaling server configured.
|
||||
block(sessionId, nil, 0);
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче