From 6491c55011d8c677b776a7ba66c21031f689c2d2 Mon Sep 17 00:00:00 2001 From: Melvin Keskin Date: Sat, 15 Jan 2022 13:55:18 +0100 Subject: Split up ATM parts of trust storage and refactor (#388) QXmppTrustStorage is now the base class for all trust storages used by end-to-end encryption managers. QXmppAtmTrustStorage is used by QXmppAtmManager. QXmppTrustMemoryStorage is now the base class for all trust storages that use the memory for storing data. QXmppAtmTrustMemoryStorage can be used by QXmppAtmManager. Methods needed by the upcoming OMEMO implementation are added. Some existing methods are refactored. --- src/client/QXmppTrustMemoryStorage.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/client/QXmppTrustMemoryStorage.h') diff --git a/src/client/QXmppTrustMemoryStorage.h b/src/client/QXmppTrustMemoryStorage.h index 63b8a14e..08696039 100644 --- a/src/client/QXmppTrustMemoryStorage.h +++ b/src/client/QXmppTrustMemoryStorage.h @@ -5,39 +5,40 @@ #ifndef QXMPPTRUSTMEMORYSTORAGE_H #define QXMPPTRUSTMEMORYSTORAGE_H -#include "QXmppGlobal.h" #include "QXmppTrustStorage.h" #include class QXmppTrustMemoryStoragePrivate; -class QXMPP_EXPORT QXmppTrustMemoryStorage : public QXmppTrustStorage +class QXMPP_EXPORT QXmppTrustMemoryStorage : virtual public QXmppTrustStorage { public: QXmppTrustMemoryStorage(); ~QXmppTrustMemoryStorage(); /// \cond - QFuture setSecurityPolicies(const QString &encryption = {}, SecurityPolicy securityPolicy = QXmppTrustStorage::NoSecurityPolicy) override; + QFuture setSecurityPolicy(const QString &encryption, SecurityPolicy securityPolicy) override; + QFuture resetSecurityPolicy(const QString &encryption) override; QFuture securityPolicy(const QString &encryption) override; - QFuture addOwnKey(const QString &encryption, const QByteArray &keyId) override; - QFuture removeOwnKey(const QString &encryption) override; + QFuture setOwnKey(const QString &encryption, const QByteArray &keyId) override; + QFuture resetOwnKey(const QString &encryption) override; QFuture ownKey(const QString &encryption) override; QFuture addKeys(const QString &encryption, const QString &keyOwnerJid, const QList &keyIds, TrustLevel trustLevel = TrustLevel::AutomaticallyDistrusted) override; - QFuture removeKeys(const QString &encryption = {}, const QList &keyIds = {}) override; + QFuture removeKeys(const QString &encryption, const QList &keyIds) override; + QFuture removeKeys(const QString &encryption, const QString &keyOwnerJid) override; + QFuture removeKeys(const QString &encryption) override; QFuture>> keys(const QString &encryption, TrustLevels trustLevels = {}) override; + QFuture>> keys(const QString &encryption, const QList &keyOwnerJids, TrustLevels trustLevels = {}) override; + QFuture hasKey(const QString &encryption, const QString &keyOwnerJid, TrustLevels trustLevels) override; QFuture setTrustLevel(const QString &encryption, const QMultiHash &keyIds, const TrustLevel trustLevel) override; QFuture setTrustLevel(const QString &encryption, const QList &keyOwnerJids, const TrustLevel oldTrustLevel, const TrustLevel newTrustLevel) override; QFuture trustLevel(const QString &encryption, const QByteArray &keyId) override; - QFuture addKeysForPostponedTrustDecisions(const QString &encryption, const QByteArray &senderKeyId, const QList &keyOwners) override; - QFuture removeKeysForPostponedTrustDecisions(const QString &encryption, const QList &keyIdsForAuthentication, const QList &keyIdsForDistrusting) override; - QFuture removeKeysForPostponedTrustDecisions(const QString &encryption = {}, const QList &senderKeyIds = {}) override; - QFuture>> keysForPostponedTrustDecisions(const QString &encryption, const QList &senderKeyIds = {}) override; + QFuture resetAll(const QString &encryption) override; /// \endcond private: -- cgit v1.2.3