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
Родитель 8ddf11d960
Коммит 968289cbf0
3 изменённых файлов: 9 добавлений и 0 удалений

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

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

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

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

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

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