diff --git a/src/gui/accountstate.cpp b/src/gui/accountstate.cpp index c5393885d6dec..3c55cbfeb5c1f 100644 --- a/src/gui/accountstate.cpp +++ b/src/gui/accountstate.cpp @@ -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. diff --git a/src/libsync/account.h b/src/libsync/account.h index b7702e525fdf8..6e38f75c25180 100644 --- a/src/libsync/account.h +++ b/src/libsync/account.h @@ -378,6 +378,8 @@ public slots: void lockFileSuccess(); void lockFileError(const QString&); + void termsOfServiceNeedToBeChecked(); + protected Q_SLOTS: void slotCredentialsFetched(); void slotCredentialsAsked(); diff --git a/src/libsync/discoveryphase.cpp b/src/libsync/discoveryphase.cpp index b6b383e3c9ae6..91fe904c44fba 100644 --- a/src/libsync/discoveryphase.cpp +++ b/src/libsync/discoveryphase.cpp @@ -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(); + } + emit finished(HttpError{ httpCode, msg }); deleteLater(); }