From b17284ee7d674416e0d11f1699f73fcc606262d4 Mon Sep 17 00:00:00 2001 From: Linus Jahn Date: Tue, 16 Aug 2022 21:00:15 +0200 Subject: Introduce QXmppTask & QXmppPromise MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #502. Co-authored-by: Jonah BrĂ¼chert --- src/client/QXmppAtmTrustMemoryStorage.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/client/QXmppAtmTrustMemoryStorage.cpp') diff --git a/src/client/QXmppAtmTrustMemoryStorage.cpp b/src/client/QXmppAtmTrustMemoryStorage.cpp index eb8fe4df..04c8c747 100644 --- a/src/client/QXmppAtmTrustMemoryStorage.cpp +++ b/src/client/QXmppAtmTrustMemoryStorage.cpp @@ -49,7 +49,7 @@ QXmppAtmTrustMemoryStorage::QXmppAtmTrustMemoryStorage() QXmppAtmTrustMemoryStorage::~QXmppAtmTrustMemoryStorage() = default; /// \cond -QFuture QXmppAtmTrustMemoryStorage::addKeysForPostponedTrustDecisions(const QString &encryption, const QByteArray &senderKeyId, const QList &keyOwners) +QXmppTask QXmppAtmTrustMemoryStorage::addKeysForPostponedTrustDecisions(const QString &encryption, const QByteArray &senderKeyId, const QList &keyOwners) { const auto addKeys = [&](const QXmppTrustMessageKeyOwner &keyOwner, bool trust, const QList &keyIds) { for (const auto &keyId : keyIds) { @@ -85,10 +85,10 @@ QFuture QXmppAtmTrustMemoryStorage::addKeysForPostponedTrustDecisions(cons addKeys(keyOwner, false, keyOwner.distrustedKeys()); } - return makeReadyFuture(); + return makeReadyTask(); } -QFuture QXmppAtmTrustMemoryStorage::removeKeysForPostponedTrustDecisions(const QString &encryption, const QList &keyIdsForAuthentication, const QList &keyIdsForDistrusting) +QXmppTask QXmppAtmTrustMemoryStorage::removeKeysForPostponedTrustDecisions(const QString &encryption, const QList &keyIdsForAuthentication, const QList &keyIdsForDistrusting) { for (auto itr = d->keys.find(encryption); itr != d->keys.end() && itr.key() == encryption;) { @@ -101,10 +101,10 @@ QFuture QXmppAtmTrustMemoryStorage::removeKeysForPostponedTrustDecisions(c } } - return makeReadyFuture(); + return makeReadyTask(); } -QFuture QXmppAtmTrustMemoryStorage::removeKeysForPostponedTrustDecisions(const QString &encryption, const QList &senderKeyIds) +QXmppTask QXmppAtmTrustMemoryStorage::removeKeysForPostponedTrustDecisions(const QString &encryption, const QList &senderKeyIds) { for (auto itr = d->keys.find(encryption); itr != d->keys.end() && itr.key() == encryption;) { @@ -115,16 +115,16 @@ QFuture QXmppAtmTrustMemoryStorage::removeKeysForPostponedTrustDecisions(c } } - return makeReadyFuture(); + return makeReadyTask(); } -QFuture QXmppAtmTrustMemoryStorage::removeKeysForPostponedTrustDecisions(const QString &encryption) +QXmppTask QXmppAtmTrustMemoryStorage::removeKeysForPostponedTrustDecisions(const QString &encryption) { d->keys.remove(encryption); - return makeReadyFuture(); + return makeReadyTask(); } -QFuture>> QXmppAtmTrustMemoryStorage::keysForPostponedTrustDecisions(const QString &encryption, const QList &senderKeyIds) +QXmppTask>> QXmppAtmTrustMemoryStorage::keysForPostponedTrustDecisions(const QString &encryption, const QList &senderKeyIds) { QHash> keys; @@ -135,13 +135,13 @@ QFuture>> QXmppAtmTrustMemoryStorage } } - return makeReadyFuture(std::move(keys)); + return makeReadyTask(std::move(keys)); } -QFuture QXmppAtmTrustMemoryStorage::resetAll(const QString &encryption) +QXmppTask QXmppAtmTrustMemoryStorage::resetAll(const QString &encryption) { QXmppTrustMemoryStorage::resetAll(encryption); d->keys.remove(encryption); - return makeReadyFuture(); + return makeReadyTask(); } /// \endcond -- cgit v1.2.3