Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove request to config for userVisibleURL. #3552

Merged
merged 1 commit into from
Jul 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions src/gui/connectionvalidator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
Expand Down
4 changes: 1 addition & 3 deletions src/gui/connectionvalidator.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ namespace OCC {
+---------------------------+
|
+-> checkServerCapabilities --------------v (in parallel)
JsonApiJob (cloud/capabilities) JsonApiJob (ocs/v1.php/config)
| +-> ocsConfigReceived
JsonApiJob (cloud/capabilities)
+-> slotCapabilitiesRecieved -+
|
+---------------------------------+
Expand Down Expand Up @@ -131,7 +130,6 @@ protected slots:
void reportResult(Status status);
void checkServerCapabilities();
void fetchUser();
static void ocsConfigReceived(const QJsonDocument &json, AccountPtr account);

/** Sets the account's server version
*
Expand Down