QXmpp Version: 1.5.6
|
Classes | |
struct | Cancelled |
struct | SendSuccess |
struct | Success |
Typedefs | |
using | SendResult = std::variant< SendSuccess, QXmppError > |
Enumerations | |
enum | EncryptionMethod { NoEncryption , UnknownEncryption , Otr , LegacyOpenPgp , Ox , Omemo0 , Omemo1 , Omemo2 , OTR = Otr , LegacyOpenPGP = LegacyOpenPgp , OX = Ox , OMEMO = Omemo0 } |
enum | SceMode : uint8_t { SceAll , ScePublic , SceSensitive } |
enum | Cipher { Aes128GcmNoPad , Aes256GcmNoPad , Aes256CbcPkcs7 } |
enum class | HashAlgorithm : uint32_t { Unknown , Md2 , Md5 , Shake128 , Shake256 , Sha1 , Sha224 , Sha256 , Sha384 , Sha512 , Sha3_256 , Sha3_512 , Blake2b_256 , Blake2b_512 } |
enum class | SendError : uint8_t { SocketWriteError , Disconnected , EncryptionError } |
enum class | TrustLevel { Undecided = 1 , AutomaticallyDistrusted = 2 , ManuallyDistrusted = 4 , AutomaticallyTrusted = 8 , ManuallyTrusted = 16 , Authenticated = 32 } |
enum | TrustSecurityPolicy { NoSecurityPolicy , Toakafa } |
Functions | |
constexpr bool | operator& (SceMode mode1, SceMode mode2) |
template<typename... IqTypes, typename Handler > | |
bool | handleIqRequests (const QDomElement &element, const std::optional< QXmppE2eeMetadata > &e2eeMetadata, QXmppClient *client, Handler handler) |
template<typename... IqTypes, typename Handler > | |
bool | handleIqRequests (const QDomElement &element, QXmppClient *client, Handler handler) |
Contains global functions and enumerations.
using QXmpp::SendResult = typedef std::variant<SendSuccess, QXmppError> |
A variant containing either a SendSuccess object or a QXmppError.
The QXmppError will likely contain a SendError.
enum QXmpp::Cipher |
Cipher for encrypting data streams and files.
This enum describes different end-to-end encryption methods. These can be used to mark a stanza as encrypted or decrypted with a specific algorithm (e.g., for XEP-0380: Explicit Message Encryption).
Enumerator | |
---|---|
NoEncryption | No encryption. |
UnknownEncryption | Unknown encryption. |
Otr | |
LegacyOpenPgp | |
Ox | |
Omemo0 | |
Omemo1 | XEP-0384: OMEMO Encryption since version 0.4 |
Omemo2 | XEP-0384: OMEMO Encryption since version 0.8 |
OTR | XEP-0364: Current Off-the-Record Messaging Usage
|
LegacyOpenPGP | XEP-0027: Current Jabber OpenPGP Usage
|
OX |
|
OMEMO |
|
|
strong |
One of the hash algorithms specified by the IANA registry or XEP-0300: Use of Cryptographic Hash Functions in XMPP.
enum QXmpp::SceMode : uint8_t |
Parsing/serialization mode when using Stanza Content Encryption.
Enumerator | |
---|---|
SceAll | Processes all known elements. |
ScePublic | Only processes 'public' elements (e.g. needed for routing). |
SceSensitive | Only processes sensitive elements that should be encrypted. |
|
strong |
Describes the type of a packet sending error.
|
strong |
Trust level of public long-term keys used by end-to-end encryption protocols
Enumerator | |
---|---|
Undecided | The key's trust is not decided. |
AutomaticallyDistrusted | The key is automatically distrusted (e.g., by the security policy TOAKAFA).
|
ManuallyDistrusted | The key is manually distrusted (e.g., by clicking a button or XEP-0450: Automatic Trust Management (ATM)). |
AutomaticallyTrusted | The key is automatically trusted (e.g., by the client for all keys of a bare JID until one of it is authenticated). |
ManuallyTrusted | The key is manually trusted (e.g., by clicking a button). |
Authenticated | The key is authenticated (e.g., by QR code scanning or XEP-0450: Automatic Trust Management (ATM)). |
Security policy to decide which public long-term keys are used for encryption because they are trusted
Enumerator | |
---|---|
NoSecurityPolicy | New keys must be trusted manually. |
Toakafa | New keys are trusted automatically until the first authentication but automatically distrusted afterwards. |
bool QXmpp::handleIqRequests | ( | const QDomElement & | element, |
const std::optional< QXmppE2eeMetadata > & | e2eeMetadata, | ||
QXmppClient * | client, | ||
Handler | handler | ||
) |
Parses IQ requests, calls a handler and sends an IQ result or error.
It is the easiest to explain this function with a few examples.
It is also possible to handle multiple IQ types.
It doesn't need to be a std::variant, it's only important that the object is callable with all the IQ types. You can for example use different lambdas per type using this 'overloaded' helper.
And another option is to an object with handleIq()
functions.
The return type of the handler function can be:
You don't need to set the values for id or the to address on the IQ result because that's done automatically. Unless you want to return an error IQ you also don't need to set the IQ type.
If you return an QXmppStanza::Error, a normal QXmppIq with the error will be sent.
The provided optional QXmppE2eeMetadata is set on the parsed IQ and used to correctly encrypt the IQ response using QXmppClient::reply().
element | The DOM element that might contain an IQ. |
e2eeMetadata | The end-to-end encryption metadata that is used to encrypt the response correctly and to be set on the parsed IQ. |
client | The client that should be used to send the response. |
handler | Function that can handle the IQ types from the template parameter or an object that has handleIq() functions for each of the IQ types. |
bool QXmpp::handleIqRequests | ( | const QDomElement & | element, |
QXmppClient * | client, | ||
Handler | handler | ||
) |
Parses IQ requests, calls a handler and sends an IQ result or error.
It is the easiest to explain this function with a few examples.
It is also possible to handle multiple IQ types.
It doesn't need to be a std::variant, it's only important that the object is callable with all the IQ types. You can for example use different lambdas per type using this 'overloaded' helper.
And another option is to an object with handleIq()
functions.
The return type of the handler function can be:
You don't need to set the values for id or the to address on the IQ result because that's done automatically. Unless you want to return an error IQ you also don't need to set the IQ type.
If you return an QXmppStanza::Error, a normal QXmppIq with the error will be sent.
element | The DOM element that might contain an IQ. |
client | The client that should be used to send the response. |
handler | Function that can handle the IQ types from the template parameter or an object that has handleIq() functions for each of the IQ types. |