QXmpp::Messages Namespace
namespace QXmpp::Messages| Header: | #include <QXmppMessages.h> |
| Since: | QXmpp 1.18 |
Classes
(since QXmpp 1.18) class | ArchiveInfo |
| struct | ConfirmDelivery |
(since QXmpp 1.18) class | Context |
| class | EncryptionSelection |
| class | OutgoingMessage |
| struct | Prepare |
| struct | Received |
| struct | ResolveRecipients |
| struct | ResolveSender |
| struct | SelectEncryption |
Types
| enum class | DecryptionState { NotEncrypted, Decrypted, NoEnvelope, Failed, Unsupported } |
| enum class | Origin { Stream, CarbonReceived, CarbonSent, Mam, Injected } |
Detailed Description
Processing of incoming and outgoing messages.
Incoming messages run through these phases:
- Unwrap: the stream, carbons and MAM create a Context with their Origin.
- ResolveSender: asynchronous, e.g. MUC sets the real sender.
- Decrypt: asynchronous, via the provider of the encryption method (QXmpp::E2ee::Provider).
- Received: synchronous, handlers consume the message.
- Deliver: QXmppClient::messageReceived() if no handler consumed the message.
Messages of the same conversation are processed in the order in which they were received, also across the asynchronous decryption.
Messages sent via QXmppClient::send() (and the deprecated QXmppClient::sendSensitive() and QXmppClient::reply()) run through these phases:
- SelectEncryption: asynchronous, usually the application selects the encryption with its policy per contact.
- Prepare: synchronous, handlers add elements or cancel sending.
- ResolveRecipients: asynchronous, only for encrypted messages, e.g. MUC sets the members of the room.
- Encrypt: asynchronous, via the provider of the selected encryption (QXmpp::E2ee::Provider). The public part of Explicit Message Encryption (XEP-0380: Explicit Message Encryption) and a fallback body are added for messages with a body.
- Send.
- ConfirmDelivery: asynchronous, e.g. MUC waits for the reflection of the room. The task returned by QXmppClient::send() finishes afterwards.
Outgoing messages to the same JID are sent in the order in which they were passed, also across the asynchronous phases. Waiting for the confirmation of the delivery does not block the next message.
The encryption of IQs is selected via QXmpp::Iq::SelectEncryption.
Classes
class ArchiveInfo
class ConfirmDelivery
class Context
class EncryptionSelection
class OutgoingMessage
class Prepare
class Received
class ResolveRecipients
class ResolveSender
class SelectEncryption
Type Documentation
enum class Messages::DecryptionState
| Constant | Value | Description |
|---|---|---|
QXmpp::Messages::DecryptionState::NotEncrypted | 0 | The message was not end-to-end encrypted. |
QXmpp::Messages::DecryptionState::Decrypted | 1 | The message was decrypted. |
QXmpp::Messages::DecryptionState::NoEnvelope | 2 | The message is encrypted, but not for this device, e.g. an own message reflected by a MUC. |
QXmpp::Messages::DecryptionState::Failed | 3 | The decryption failed, see Context::decryptionError(). |
QXmpp::Messages::DecryptionState::Unsupported | 4 | There is no provider for the encryption method. |
enum class Messages::Origin
Where an incoming message came from.
| Constant | Value | Description |
|---|---|---|
QXmpp::Messages::Origin::Stream | 0 | Received directly from the server. |
QXmpp::Messages::Origin::CarbonReceived | 1 | Copy of a message received by another own device. |
QXmpp::Messages::Origin::CarbonSent | 2 | Copy of a message sent by another own device. |
QXmpp::Messages::Origin::Mam | 3 | Result of an archive query, not delivered as a live message. The context has a QXmpp::Messages::ArchiveInfo attachment. |
QXmpp::Messages::Origin::Injected | 4 | Injected by an extension via QXmppClientExtension::injectMessage(). |