aboutsummaryrefslogtreecommitdiff
path: root/src/client/QXmppAtmTrustMemoryStorage.cpp
diff options
context:
space:
mode:
authorLinus Jahn <lnj@kaidan.im>2022-08-16 21:00:15 +0200
committerLinus Jahn <lnj@kaidan.im>2023-01-03 22:05:54 +0100
commitb17284ee7d674416e0d11f1699f73fcc606262d4 (patch)
tree86597f2bc2a1ed2d257e0cbf8e7de1ca54080c08 /src/client/QXmppAtmTrustMemoryStorage.cpp
parent3271c6642439d4d3c0d8c634e2b3f4cf17b908a0 (diff)
downloadqxmpp-b17284ee7d674416e0d11f1699f73fcc606262d4.tar.gz
Introduce QXmppTask & QXmppPromise
Closes #502. Co-authored-by: Jonah BrĂ¼chert <jbb@kaidan.im>
Diffstat (limited to 'src/client/QXmppAtmTrustMemoryStorage.cpp')
-rw-r--r--src/client/QXmppAtmTrustMemoryStorage.cpp24
1 files changed, 12 insertions, 12 deletions
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<void> QXmppAtmTrustMemoryStorage::addKeysForPostponedTrustDecisions(const QString &encryption, const QByteArray &senderKeyId, const QList<QXmppTrustMessageKeyOwner> &keyOwners)
+QXmppTask<void> QXmppAtmTrustMemoryStorage::addKeysForPostponedTrustDecisions(const QString &encryption, const QByteArray &senderKeyId, const QList<QXmppTrustMessageKeyOwner> &keyOwners)
{
const auto addKeys = [&](const QXmppTrustMessageKeyOwner &keyOwner, bool trust, const QList<QByteArray> &keyIds) {
for (const auto &keyId : keyIds) {
@@ -85,10 +85,10 @@ QFuture<void> QXmppAtmTrustMemoryStorage::addKeysForPostponedTrustDecisions(cons
addKeys(keyOwner, false, keyOwner.distrustedKeys());
}
- return makeReadyFuture();
+ return makeReadyTask();
}
-QFuture<void> QXmppAtmTrustMemoryStorage::removeKeysForPostponedTrustDecisions(const QString &encryption, const QList<QByteArray> &keyIdsForAuthentication, const QList<QByteArray> &keyIdsForDistrusting)
+QXmppTask<void> QXmppAtmTrustMemoryStorage::removeKeysForPostponedTrustDecisions(const QString &encryption, const QList<QByteArray> &keyIdsForAuthentication, const QList<QByteArray> &keyIdsForDistrusting)
{
for (auto itr = d->keys.find(encryption);
itr != d->keys.end() && itr.key() == encryption;) {
@@ -101,10 +101,10 @@ QFuture<void> QXmppAtmTrustMemoryStorage::removeKeysForPostponedTrustDecisions(c
}
}
- return makeReadyFuture();
+ return makeReadyTask();
}
-QFuture<void> QXmppAtmTrustMemoryStorage::removeKeysForPostponedTrustDecisions(const QString &encryption, const QList<QByteArray> &senderKeyIds)
+QXmppTask<void> QXmppAtmTrustMemoryStorage::removeKeysForPostponedTrustDecisions(const QString &encryption, const QList<QByteArray> &senderKeyIds)
{
for (auto itr = d->keys.find(encryption);
itr != d->keys.end() && itr.key() == encryption;) {
@@ -115,16 +115,16 @@ QFuture<void> QXmppAtmTrustMemoryStorage::removeKeysForPostponedTrustDecisions(c
}
}
- return makeReadyFuture();
+ return makeReadyTask();
}
-QFuture<void> QXmppAtmTrustMemoryStorage::removeKeysForPostponedTrustDecisions(const QString &encryption)
+QXmppTask<void> QXmppAtmTrustMemoryStorage::removeKeysForPostponedTrustDecisions(const QString &encryption)
{
d->keys.remove(encryption);
- return makeReadyFuture();
+ return makeReadyTask();
}
-QFuture<QHash<bool, QMultiHash<QString, QByteArray>>> QXmppAtmTrustMemoryStorage::keysForPostponedTrustDecisions(const QString &encryption, const QList<QByteArray> &senderKeyIds)
+QXmppTask<QHash<bool, QMultiHash<QString, QByteArray>>> QXmppAtmTrustMemoryStorage::keysForPostponedTrustDecisions(const QString &encryption, const QList<QByteArray> &senderKeyIds)
{
QHash<bool, QMultiHash<QString, QByteArray>> keys;
@@ -135,13 +135,13 @@ QFuture<QHash<bool, QMultiHash<QString, QByteArray>>> QXmppAtmTrustMemoryStorage
}
}
- return makeReadyFuture(std::move(keys));
+ return makeReadyTask(std::move(keys));
}
-QFuture<void> QXmppAtmTrustMemoryStorage::resetAll(const QString &encryption)
+QXmppTask<void> QXmppAtmTrustMemoryStorage::resetAll(const QString &encryption)
{
QXmppTrustMemoryStorage::resetAll(encryption);
d->keys.remove(encryption);
- return makeReadyFuture();
+ return makeReadyTask();
}
/// \endcond