Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
This commit is contained in:
Marcel Müller 2022-12-18 12:12:15 +01:00
Родитель 3af96eb587
Коммит 71e888d40f
1 изменённых файлов: 25 добавлений и 20 удалений

Просмотреть файл

@ -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);
} }
}]; }];
} }