Skip to content

Commit

Permalink
improve logs when checking terms of service status
Browse files Browse the repository at this point in the history
should help diagnosing a client stuck with ToS block while thinking they
had been accepted

Signed-off-by: Matthieu Gallien <[email protected]>
  • Loading branch information
mgallien authored and backportbot[bot] committed Oct 23, 2024
1 parent f44fa29 commit 4ec447f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/gui/connectionvalidator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,25 +378,29 @@ void TermsOfServiceChecker::start()

void TermsOfServiceChecker::slotServerTermsOfServiceRecieved(const QJsonDocument &reply)
{
qCDebug(lcConnectionValidator) << "Terms of service status" << reply;
qCInfo(lcConnectionValidator) << "Terms of service status" << reply;

if (reply.object().contains("ocs")) {
const auto needToSign = !reply.object().value("ocs").toObject().value("data").toObject().value("hasSigned").toBool(false);
if (needToSign != _needToSign) {
qCInfo(lcConnectionValidator) << "_needToSign" << (_needToSign ? "need to sign" : "no need to sign");
_needToSign = needToSign;
emit needToSignChanged();
}
} else if (_needToSign) {
_needToSign = false;
qCInfo(lcConnectionValidator) << "_needToSign" << (_needToSign ? "need to sign" : "no need to sign");
emit needToSignChanged();

Check warning on line 393 in src/gui/connectionvalidator.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/connectionvalidator.cpp:393:14 [modernize-use-trailing-return-type]

use a trailing return type for this function
}

qCInfo(lcConnectionValidator) << "done";
emit done();

Check warning on line 397 in src/gui/connectionvalidator.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/connectionvalidator.cpp:397:10 [modernize-use-trailing-return-type]

use a trailing return type for this function
}

void TermsOfServiceChecker::checkServerTermsOfService()
{
if (!_account) {
qCInfo(lcConnectionValidator) << "done";
emit done();

Check warning on line 404 in src/gui/connectionvalidator.cpp

View workflow job for this annotation

GitHub Actions / build

src/gui/connectionvalidator.cpp:404:14 [modernize-use-trailing-return-type]

use a trailing return type for this function
}

Expand Down

0 comments on commit 4ec447f

Please sign in to comment.