Remove request to config for userVisibleURL.

Signed-off-by: allexzander <blackslayer4@gmail.com>
This commit is contained in:
allexzander 2021-07-15 10:53:31 +03:00 committed by allexzander (Rebase PR Action)
parent 5fe4784cbc
commit de627a9b7c
2 changed files with 1 additions and 25 deletions

View file

@ -227,17 +227,6 @@ void ConnectionValidator::checkServerCapabilities()
job->setTimeout(timeoutToUseMsec);
QObject::connect(job, &JsonApiJob::jsonReceived, this, &ConnectionValidator::slotCapabilitiesRecieved);
job->start();
// And we'll retrieve the ocs config in parallel
// note that 'this' might be destroyed before the job finishes, so intentionally not parented
auto configJob = new JsonApiJob(_account, QLatin1String("ocs/v1.php/config"));
configJob->setTimeout(timeoutToUseMsec);
auto account = _account; // capturing account by value will make it live long enough
QObject::connect(configJob, &JsonApiJob::jsonReceived, _account.data(),
[=](const QJsonDocument &json) {
ocsConfigReceived(json, account);
});
configJob->start();
}
void ConnectionValidator::slotCapabilitiesRecieved(const QJsonDocument &json)
@ -260,17 +249,6 @@ void ConnectionValidator::slotCapabilitiesRecieved(const QJsonDocument &json)
fetchUser();
}
void ConnectionValidator::ocsConfigReceived(const QJsonDocument &json, AccountPtr account)
{
QString host = json.object().value("ocs").toObject().value("data").toObject().value("host").toString();
if (host.isEmpty()) {
qCWarning(lcConnectionValidator) << "Could not extract 'host' from ocs config reply";
return;
}
qCInfo(lcConnectionValidator) << "Determined user-visible host to be" << host;
account->setUserVisibleHost(host);
}
void ConnectionValidator::fetchUser()
{
auto *userInfo = new UserInfo(_accountState.data(), true, true, this);

View file

@ -60,8 +60,7 @@ namespace OCC {
+---------------------------+
|
+-> checkServerCapabilities --------------v (in parallel)
JsonApiJob (cloud/capabilities) JsonApiJob (ocs/v1.php/config)
| +-> ocsConfigReceived
JsonApiJob (cloud/capabilities)
+-> slotCapabilitiesRecieved -+
|
+---------------------------------+
@ -131,7 +130,6 @@ private:
void reportResult(Status status);
void checkServerCapabilities();
void fetchUser();
static void ocsConfigReceived(const QJsonDocument &json, AccountPtr account);
/** Sets the account's server version
*