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/QXmppAtmTrustMemoryStorage.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/client/QXmppAtmTrustMemoryStorage.h (limited to 'src/client/QXmppAtmTrustMemoryStorage.h') diff --git a/src/client/QXmppAtmTrustMemoryStorage.h b/src/client/QXmppAtmTrustMemoryStorage.h new file mode 100644 index 00000000..432c2058 --- /dev/null +++ b/src/client/QXmppAtmTrustMemoryStorage.h @@ -0,0 +1,33 @@ +// SPDX-FileCopyrightText: 2022 Melvin Keskin +// +// SPDX-License-Identifier: LGPL-2.1-or-later + +#ifndef QXMPPATMTRUSTMEMORYSTORAGE_H +#define QXMPPATMTRUSTMEMORYSTORAGE_H + +#include "QXmppAtmTrustStorage.h" +#include "QXmppTrustMemoryStorage.h" + +class QXmppAtmTrustMemoryStoragePrivate; + +class QXMPP_EXPORT QXmppAtmTrustMemoryStorage : virtual public QXmppAtmTrustStorage, public QXmppTrustMemoryStorage +{ +public: + QXmppAtmTrustMemoryStorage(); + ~QXmppAtmTrustMemoryStorage(); + + /// \cond + 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 removeKeysForPostponedTrustDecisions(const QString &encryption) override; + QFuture>> keysForPostponedTrustDecisions(const QString &encryption, const QList &senderKeyIds = {}) override; + + QFuture resetAll(const QString &encryption) override; + /// \endcond + +private: + std::unique_ptr d; +}; + +#endif // QXMPPATMTRUSTMEMORYSTORAGE_H -- cgit v1.2.3