diff options
| author | Melvin Keskin <melvo@olomono.de> | 2021-08-28 14:39:02 +0200 |
|---|---|---|
| committer | Linus Jahn <lnj@kaidan.im> | 2021-09-16 18:43:00 +0200 |
| commit | bb8780ecdbfe7eddb8280e696871e71b744d0bff (patch) | |
| tree | 585989b6e6a58c3f2af42c0681d87e93e2c592e7 /src/client/QXmppAtmManager.h | |
| parent | b147ea5f4004cbd9aa2e7ae3936734a869bf3a44 (diff) | |
| download | qxmpp-bb8780ecdbfe7eddb8280e696871e71b744d0bff.tar.gz | |
Add QXmppAtmManager
Diffstat (limited to 'src/client/QXmppAtmManager.h')
| -rw-r--r-- | src/client/QXmppAtmManager.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/src/client/QXmppAtmManager.h b/src/client/QXmppAtmManager.h new file mode 100644 index 00000000..2df2dfce --- /dev/null +++ b/src/client/QXmppAtmManager.h @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2008-2021 The QXmpp developers + * + * Author: + * Melvin Keskin <melvo@olomono.de> + * + * Source: + * https://github.com/qxmpp-project/qxmpp + * + * This file is a part of QXmpp library. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + */ + +#ifndef QXMPPATMMANAGER_H +#define QXMPPATMMANAGER_H + +#include "QXmppClientExtension.h" +#include "QXmppMessage.h" +#include "QXmppSendResult.h" +#include "QXmppTrustMessageKeyOwner.h" +#include "QXmppTrustStorage.h" + +class QXMPP_EXPORT QXmppAtmManager : public QXmppClientExtension +{ + Q_OBJECT + +public: + QXmppAtmManager(QXmppTrustStorage *trustStorage); + QFuture<void> makeTrustDecisions(const QString &encryption, const QString &keyOwnerJid, const QList<QString> &keyIdsForAuthentication, const QList<QString> &keyIdsForDistrusting = {}); + + /// \cond + bool handleStanza(const QDomElement &stanza) override; + +protected: + void setClient(QXmppClient *client) override; + +private slots: + void handleMessageReceived(const QXmppMessage &message); + /// \endcond + +private: + QFuture<void> makeTrustDecisions(const QString &encryption, const QMultiHash<QString, QString> &keyIdsForAuthentication, const QMultiHash<QString, QString> &keyIdsForDistrusting); + QFuture<void> handleMessage(const QXmppMessage &message); + + QFuture<void> authenticate(const QString &encryption, const QMultiHash<QString, QString> &keyIds); + QFuture<void> distrust(const QString &encryption, const QMultiHash<QString, QString> &keyIds); + + QFuture<void> distrustAutomaticallyTrustedKeys(const QString &encryption, const QList<QString> &keyOwnerJids); + QFuture<void> makePostponedTrustDecisions(const QString &encryption, const QList<QString> &senderKeyIds); + + QFuture<QXmpp::SendResult> sendTrustMessage(const QString &encryption, const QList<QXmppTrustMessageKeyOwner> &keyOwners, const QString &recipientJid); + + QXmppTrustStorage *m_trustStorage; + + friend class tst_QXmppAtmManager; +}; + +#endif // QXMPPATMMANAGER_H |
