QXmppSendStanzaParams Class
| Header: | #include <QXmppSendStanzaParams.h> |
| Since: | QXmpp 1.5 |
Public Functions
| QXmppSendStanzaParams(const QXmppSendStanzaParams &other) | |
| QXmppSendStanzaParams(QXmppSendStanzaParams &&) | |
| std::optional<QXmpp::TrustLevels> | acceptedTrustLevels() const |
| QList<QString> | encryptionJids() const |
(since QXmpp 1.18) std::optional<QString> | forcedEncryption() const |
(since QXmpp 1.18) bool | isEncryptionRequired() const |
| void | setAcceptedTrustLevels(std::optional<QXmpp::TrustLevels> trustLevels) |
| void | setEncryptionJids(QList<QString> encryptionJids) |
(since QXmpp 1.18) void | setEncryptionRequired(bool required) |
(since QXmpp 1.18) void | setForcedEncryption(std::optional<QString> encryption) |
| QXmppSendStanzaParams & | operator=(QXmppSendStanzaParams &&) |
| QXmppSendStanzaParams & | operator=(const QXmppSendStanzaParams &) |
Detailed Description
Contains additional parameters for sending stanzas.
Member Function Documentation
QXmppSendStanzaParams::QXmppSendStanzaParams(const QXmppSendStanzaParams &other)
Copy-constructor
QXmppSendStanzaParams::QXmppSendStanzaParams(QXmppSendStanzaParams &&)
Move-constructor
std::optional<QXmpp::TrustLevels> QXmppSendStanzaParams::acceptedTrustLevels() const
Returns the possible trust levels a key must have to be used for encryption (the trust levels of the keys used for encryption).
If no trust levels are set, the encryption manager uses an own default.
See also setAcceptedTrustLevels().
QList<QString> QXmppSendStanzaParams::encryptionJids() const
Returns the list of JIDs that the stanza should be encrypted for.
If this is empty, the stanza should be encrypted for the recipient. This option is useful for groupchats.
See also setEncryptionJids().
[since QXmpp 1.18] std::optional<QString> QXmppSendStanzaParams::forcedEncryption() const
Returns the end-to-end encryption forced for a message or IQ instead of selecting it via the QXmpp::Messages::SelectEncryption hook (or QXmpp::Iq::SelectEncryption for IQs): the namespace of the encryption (see QXmpp::E2ee) or an empty string for sending it unencrypted.
By default, it is not set and the encryption is selected via the hook.
This function was introduced in QXmpp 1.18.
See also setForcedEncryption().
[since QXmpp 1.18] bool QXmppSendStanzaParams::isEncryptionRequired() const
Returns whether sending a message or IQ fails if it can not be end-to-end encrypted.
This function was introduced in QXmpp 1.18.
void QXmppSendStanzaParams::setAcceptedTrustLevels(std::optional<QXmpp::TrustLevels> trustLevels)
Sets the possible trustLevels a key must have to be used for encryption.
If no trust levels are set, the encryption manager uses an own default.
See also acceptedTrustLevels().
void QXmppSendStanzaParams::setEncryptionJids(QList<QString> encryptionJids)
Sets the list of JIDs that the stanza should be encrypted for.
If this is empty, the stanza should be encrypted for the recipient. This option is useful for groupchats.
encryptionJids.
See also encryptionJids().
[since QXmpp 1.18] void QXmppSendStanzaParams::setEncryptionRequired(bool required)
Sets whether sending a message or IQ fails if it can not be end-to-end encrypted.
If set, sending fails with QXmpp::SendError::EncryptionError if no encryption is selected by the QXmpp::Messages::SelectEncryption hook (or QXmpp::Iq::SelectEncryption for IQs), instead of sending the stanza unencrypted. Sensitive stanzas sent by QXmpp's managers (and via the deprecated QXmppClient::sendSensitive()) are still encrypted with the deprecated encryption extension (QXmppClient::setEncryptionExtension()) if no encryption is selected.
required.
This function was introduced in QXmpp 1.18.
See also isEncryptionRequired().
[since QXmpp 1.18] void QXmppSendStanzaParams::setForcedEncryption(std::optional<QString> encryption)
Forces the end-to-end encryption of a message or IQ instead of selecting it via the QXmpp::Messages::SelectEncryption hook (or QXmpp::Iq::SelectEncryption for IQs): the namespace of the encryption (see QXmpp::E2ee) or an empty string for sending it unencrypted, e.g. after the user has confirmed that.
Sending fails if no provider of the encryption is registered or if the stanza must be encrypted (isEncryptionRequired()) and an empty string is given.
This function was introduced in QXmpp 1.18.
See also forcedEncryption().
QXmppSendStanzaParams &QXmppSendStanzaParams::operator=(QXmppSendStanzaParams &&)
Move-assignment operator
QXmppSendStanzaParams &QXmppSendStanzaParams::operator=(const QXmppSendStanzaParams &)
Assignment operator