diff options
| author | Melvin Keskin <melvo@olomono.de> | 2022-05-23 15:17:12 +0200 |
|---|---|---|
| committer | Linus Jahn <lnj@kaidan.im> | 2022-06-18 13:07:44 +0200 |
| commit | cb1c0ac7ba16590304c8fe7bd6d87b69dffe5c67 (patch) | |
| tree | 99e188cbe3bf738269d59e62d38b57217d2c80d9 /src/client/QXmppSendStanzaParams.cpp | |
| parent | 31ef165cbbf918ba0ddd00f86c6dee257a0b936b (diff) | |
| download | qxmpp-cb1c0ac7ba16590304c8fe7bd6d87b69dffe5c67.tar.gz | |
SendStanzaParams: Add accepted trust levels
Diffstat (limited to 'src/client/QXmppSendStanzaParams.cpp')
| -rw-r--r-- | src/client/QXmppSendStanzaParams.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/client/QXmppSendStanzaParams.cpp b/src/client/QXmppSendStanzaParams.cpp index 3a3beaae..6c8b6ccc 100644 --- a/src/client/QXmppSendStanzaParams.cpp +++ b/src/client/QXmppSendStanzaParams.cpp @@ -18,6 +18,7 @@ class QXmppSendStanzaParamsPrivate : public QSharedData { public: QVector<QString> encryptionJids; + QXmppTrustStorage::TrustLevels acceptedTrustLevels; }; QXmppSendStanzaParams::QXmppSendStanzaParams() @@ -56,3 +57,30 @@ void QXmppSendStanzaParams::setEncryptionJids(QVector<QString> encryptionJids) { d->encryptionJids = std::move(encryptionJids); } + +/// +/// Returns the possible trust levels a key must have to be used for encryption. +/// +/// If no trust levels are set, the encryption manager uses an own default. +/// +/// \return the trust levels of the keys used for encryption +/// +std::optional<QXmppTrustStorage::TrustLevels> QXmppSendStanzaParams::acceptedTrustLevels() const +{ + if (d->acceptedTrustLevels) { + return d->acceptedTrustLevels; + } + return {}; +} + +/// +/// Sets the possible trust levels a key must have to be used for encryption. +/// +/// If no trust levels are set, the encryption manager uses an own default. +/// +/// \param trustLevels trust levels of the keys used for encryption +/// +void QXmppSendStanzaParams::setAcceptedTrustLevels(std::optional<QXmppTrustStorage::TrustLevels> trustLevels) +{ + d->acceptedTrustLevels = trustLevels.value_or(QXmppTrustStorage::TrustLevels()); +} |
