diff options
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()); +} |
