]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
content access denied error during discovery: verify server access
authorMatthieu Gallien <matthieu.gallien@nextcloud.com>
Tue, 22 Oct 2024 12:49:51 +0000 (14:49 +0200)
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>
Tue, 22 Oct 2024 13:03:45 +0000 (15:03 +0200)
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>
src/gui/accountstate.cpp
src/libsync/account.h
src/libsync/discoveryphase.cpp

index a69f5ef17356c70924c52244f2c7a10f008c5d70..59f26fe7cc54e8239e530795779fdc4794de8a85 100644 (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.
index 4afd9f654dc377fa168327b01bb55cfa92295a57..92a132ef6c48d1a874540e6049720bc8bba9acb4 100644 (file)
@@ -464,6 +464,7 @@ signals:
     void downloadLimitSettingChanged();
     void uploadLimitChanged();
     void downloadLimitChanged();
+    void termsOfServiceNeedToBeChecked();
 
 protected Q_SLOTS:
     void slotCredentialsFetched();
index 38e4a424c5a736cc59ee04238e6cb269d6c5e4e7..4cb604b9aa7daac935ae9b46c3237910488e3a1c 100644 (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();
 }