mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-22 13:05:51 +03:00
improve logs of E2EE API to not pollute logs
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
parent
7fe6a3df78
commit
f8fc720fbb
1 changed files with 7 additions and 4 deletions
|
@ -143,24 +143,27 @@ bool Capabilities::clientSideEncryptionAvailable() const
|
|||
}
|
||||
|
||||
const auto version = properties.value(QStringLiteral("api-version"), "1.0").toByteArray();
|
||||
qCInfo(lcServerCapabilities) << "E2EE API version:" << version;
|
||||
const auto splittedVersion = version.split('.');
|
||||
|
||||
bool ok = false;
|
||||
const auto major = !splittedVersion.isEmpty() ? splittedVersion.at(0).toInt(&ok) : 0;
|
||||
if (!ok) {
|
||||
qCWarning(lcServerCapabilities) << "Didn't understand version scheme (major), E2EE disabled";
|
||||
qCWarning(lcServerCapabilities) << "Didn't understand version scheme (major), E2EE disabled" << version;
|
||||
return false;
|
||||
}
|
||||
|
||||
ok = false;
|
||||
const auto minor = splittedVersion.size() > 1 ? splittedVersion.at(1).toInt(&ok) : 0;
|
||||
if (!ok) {
|
||||
qCWarning(lcServerCapabilities) << "Didn't understand version scheme (minor), E2EE disabled";
|
||||
qCWarning(lcServerCapabilities) << "Didn't understand version scheme (minor), E2EE disabled" << version;
|
||||
return false;
|
||||
}
|
||||
|
||||
return major == 1 && minor >= 1;
|
||||
const auto capabilityAvailable = (major == 1 && minor >= 1);
|
||||
if (!capabilityAvailable) {
|
||||
qCInfo(lcServerCapabilities) << "Incompatible E2EE API version:" << version;
|
||||
}
|
||||
return capabilityAvailable;
|
||||
}
|
||||
|
||||
bool Capabilities::notificationsAvailable() const
|
||||
|
|
Loading…
Reference in a new issue