diff --git a/UI/ui-validation.cpp b/UI/ui-validation.cpp index e441cbb6a..e45fd3f74 100644 --- a/UI/ui-validation.cpp +++ b/UI/ui-validation.cpp @@ -59,26 +59,24 @@ bool UIValidation::NoSourcesConfirmation(QWidget *parent) StreamSettingsAction UIValidation::StreamSettingsConfirmation(QWidget *parent, OBSService service) { - // Custom services can user API key in URL or user/pass combo. - // So only check there is a URL - char const *serviceType = obs_service_get_type(service); - bool isCustomUrlService = (strcmp(serviceType, "rtmp_custom") == 0); - - char const *streamUrl = obs_service_get_url(service); - char const *streamKey = obs_service_get_key(service); - - bool hasStreamUrl = (streamUrl != NULL && streamUrl[0] != '\0'); - bool hasStreamKey = ((streamKey != NULL && streamKey[0] != '\0') || - isCustomUrlService); - - if (hasStreamUrl && hasStreamKey) + if (obs_service_can_try_to_connect(service)) return StreamSettingsAction::ContinueStream; - QString msg; + char const *serviceType = obs_service_get_type(service); + bool isCustomService = (strcmp(serviceType, "rtmp_custom") == 0); - if (!hasStreamUrl && !hasStreamKey) { + char const *streamUrl = obs_service_get_connect_info( + service, OBS_SERVICE_CONNECT_INFO_SERVER_URL); + char const *streamKey = obs_service_get_connect_info( + service, OBS_SERVICE_CONNECT_INFO_STREAM_KEY); + + bool streamUrlMissing = !(streamUrl != NULL && streamUrl[0] != '\0'); + bool streamKeyMissing = !(streamKey != NULL && streamKey[0] != '\0'); + + QString msg; + if (!isCustomService && streamUrlMissing && streamKeyMissing) { msg = QTStr("Basic.Settings.Stream.MissingUrlAndApiKey"); - } else if (!hasStreamKey) { + } else if (!isCustomService && streamKeyMissing) { msg = QTStr("Basic.Settings.Stream.MissingStreamKey"); } else { msg = QTStr("Basic.Settings.Stream.MissingUrl");