From 4ef85abe637cc5735f12e053e0faf4dd8e159564 Mon Sep 17 00:00:00 2001 From: JBB Date: Sun, 5 Dec 2021 16:16:48 +0100 Subject: AtmManager: Fix compilation with Qt6 (#381) --- src/client/QXmppAtmManager.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src/client/QXmppAtmManager.cpp') diff --git a/src/client/QXmppAtmManager.cpp b/src/client/QXmppAtmManager.cpp index e0255a9e..1be9052f 100644 --- a/src/client/QXmppAtmManager.cpp +++ b/src/client/QXmppAtmManager.cpp @@ -409,20 +409,22 @@ QFuture QXmppAtmManager::authenticate(const QString &encryption, const QMu } else { auto future = m_trustStorage->setTrustLevel(encryption, keyIds, QXmppTrustStorage::Authenticated); await(future, this, [=]() { - if (m_trustStorage->securityPolicy(encryption) == QXmppTrustStorage::Toakafa) { - auto future = distrustAutomaticallyTrustedKeys(encryption, keyIds.uniqueKeys()); - await(future, this, [=]() { + await(m_trustStorage->securityPolicy(encryption), this, [=](const auto securityPolicy) { + if (securityPolicy == QXmppTrustStorage::Toakafa) { + auto future = distrustAutomaticallyTrustedKeys(encryption, keyIds.uniqueKeys()); + await(future, this, [=]() { + auto future = makePostponedTrustDecisions(encryption, keyIds.values()); + await(future, this, [=]() { + interface->reportFinished(); + }); + }); + } else { auto future = makePostponedTrustDecisions(encryption, keyIds.values()); await(future, this, [=]() { interface->reportFinished(); }); - }); - } else { - auto future = makePostponedTrustDecisions(encryption, keyIds.values()); - await(future, this, [=]() { - interface->reportFinished(); - }); - } + } + }); }); } -- cgit v1.2.3