content access denied error during discovery: verify server access

will trigger a check of the server connectivity in case of content
access denied reporting when listing folders during discovery

should allow discovering early that terms of service need to be signed

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
Matthieu Gallien 2024-10-22 14:49:51 +02:00 committed by backportbot[bot]
parent d6ba757585
commit 4a1538b6c4
3 changed files with 9 additions and 0 deletions

View file

@ -64,6 +64,10 @@ AccountState::AccountState(const AccountPtr &account)
this, &AccountState::slotPushNotificationsReady);
connect(account.data(), &Account::serverUserStatusChanged, this,
&AccountState::slotServerUserStatusChanged);
connect(account.data(), &Account::termsOfServiceNeedToBeChecked,
this, [this] () {
checkConnectivity();
});
connect(this, &AccountState::isConnectedChanged, [=]{
// Get the Apps available on the server if we're now connected.

View file

@ -464,6 +464,7 @@ signals:
void downloadLimitSettingChanged();
void uploadLimitChanged();
void downloadLimitChanged();
void termsOfServiceNeedToBeChecked();
protected Q_SLOTS:
void slotCredentialsFetched();

View file

@ -652,6 +652,10 @@ void DiscoverySingleDirectoryJob::lsJobFinishedWithErrorSlot(QNetworkReply *r)
msg = tr("Server error: PROPFIND reply is not XML formatted!");
}
if (r->error() == QNetworkReply::ContentAccessDenied) {
emit _account->termsOfServiceNeedToBeChecked();
}
emit finished(HttpError{ httpCode, msg });
deleteLater();
}