From ae98d55dec1984c8da77fb3bd0369d870c30003a Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Tue, 22 Oct 2024 14:49:51 +0200 Subject: [PATCH] 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 [skip ci] --- src/gui/accountstate.cpp | 4 ++++ src/libsync/discoveryphase.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/gui/accountstate.cpp b/src/gui/accountstate.cpp index 2f0026affee20..8434b4a9a3f84 100644 --- a/src/gui/accountstate.cpp +++ b/src/gui/accountstate.cpp @@ -60,6 +60,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. diff --git a/src/libsync/discoveryphase.cpp b/src/libsync/discoveryphase.cpp index cb7674ab40f0e..9b1030875ac7d 100644 --- a/src/libsync/discoveryphase.cpp +++ b/src/libsync/discoveryphase.cpp @@ -651,6 +651,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(); }