Skip to content

Commit

Permalink
content access denied error during discovery: verify server access
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
mgallien committed Oct 22, 2024
1 parent c0f53c7 commit 8fb3380
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/gui/accountstate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ AccountState::AccountState(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.
Expand Down
2 changes: 2 additions & 0 deletions src/libsync/account.h
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,8 @@ public slots:
void lockFileSuccess();
void lockFileError(const QString&);

void termsOfServiceNeedToBeChecked();

protected Q_SLOTS:
void slotCredentialsFetched();
void slotCredentialsAsked();
Expand Down
4 changes: 4 additions & 0 deletions src/libsync/discoveryphase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,10 @@ void DiscoverySingleDirectoryJob::lsJobFinishedWithErrorSlot(QNetworkReply *r)
msg = tr("Server error: PROPFIND reply is not XML formatted!");
}

if (r->error() == QNetworkReply::ContentAccessDenied) {
emit _account->termsOfServiceNeedToBeChecked();

Check warning on line 657 in src/libsync/discoveryphase.cpp

View workflow job for this annotation

GitHub Actions / build

src/libsync/discoveryphase.cpp:657:14 [cppcoreguidelines-init-variables]

variable '_account' is not initialized
}

emit finished(HttpError{ httpCode, msg });
deleteLater();
}
Expand Down

0 comments on commit 8fb3380

Please sign in to comment.