QXmpp::Omemo::EncryptionInfo Struct

The devices a message has been encrypted for, available via QXmpp::Messages::Sent::encryptionInfo() of messages encrypted with OMEMO. More...

Header: #include <QXmppOmemoManager.h>
Since: QXmpp 1.18

Public Types

struct SkippedDevice
enum class SkipReason { Untrusted, NoSession, Unresponsive, DeviceLimit, BodyOnlyUnsupported }

Detailed Description

client->sendMessage(std::move(message)).then(this, [](QXmpp::Result<QXmpp::Messages::Sent> &&result) {
    if (auto *sent = std::get_if<QXmpp::Messages::Sent>(&result)) {
        if (const auto *info = std::any_cast<QXmpp::Omemo::EncryptionInfo>(&sent->encryptionInfo())) {
            for (const auto &skipped : info->skippedDevices) {
                // e.g. show that the device can not decrypt the message
            }
        }
    }
});

With QXmpp::Omemo::Automatic, the version of each device is the one it has been encrypted with. A message for devices of both versions is reported as OMEMO 2 by QXmpp::Messages::Sent::encryption(), the devices tell which ones got OMEMO 0.

\varQXmpp::Omemo::EncryptionInfo::devices devices the message has been encrypted for, also the other own devices \var QXmpp::Omemo::EncryptionInfo::skippedDevices listed devices of the recipients and the own JID the message has not been encrypted for

Member Type Documentation

enum class EncryptionInfo::SkipReason

ConstantValueDescription
QXmpp::Omemo::EncryptionInfo::SkipReason::Untrusted0The trust level of the device is not accepted (QXmppSendStanzaParams::acceptedTrustLevels()).
QXmpp::Omemo::EncryptionInfo::SkipReason::NoSession1No session could be built, e.g. because the bundle of the device is not available or its identity key has changed.
QXmpp::Omemo::EncryptionInfo::SkipReason::Unresponsive2The device has not responded to the messages encrypted for it for too long.
QXmpp::Omemo::EncryptionInfo::SkipReason::DeviceLimit3The maximum number of devices a message is encrypted for has been reached.
QXmpp::Omemo::EncryptionInfo::SkipReason::BodyOnlyUnsupported4The device only supports OMEMO 0, which only encrypts the body, but the message can not be sent without its other elements, see QXmpp::Messages::PrepareBodyOnly.