QXmppOmemoElement Class

The QXmppOmemoElement class represents an OMEMO element as defined by XEP-0384: OMEMO Encryption. More...

Header: #include <QXmppOmemoElement>

Public Functions

void addEnvelope(const QString &recipientJid, const QXmppOmemoEnvelope &envelope)
QByteArray payload() const
std::optional<QXmppOmemoEnvelope> searchEnvelope(const QString &recipientJid, uint32_t recipientDeviceId) const
uint32_t senderDeviceId() const
void setPayload(const QByteArray &payload)
void setSenderDeviceId(uint32_t id)

Static Public Members

bool isOmemoElement(const QDomElement &element)

Detailed Description

Member Function Documentation

void QXmppOmemoElement::addEnvelope(const QString &recipientJid, const QXmppOmemoEnvelope &envelope)

Adds an OMEMO envelope for the recipient with bare JID recipientJid.

If a full JID is passed as recipientJid, it is converted into a bare JID.

See also QXmppOmemoEnvelope.

[static] bool QXmppOmemoElement::isOmemoElement(const QDomElement &element)

Determines whether the given DOM element is an OMEMO element.

Returns true if element is an OMEMO element, otherwise false.

QByteArray QXmppOmemoElement::payload() const

Returns the encrypted payload which consists of the encrypted SCE envelope.

See also setPayload().

std::optional<QXmppOmemoEnvelope> QXmppOmemoElement::searchEnvelope(const QString &recipientJid, uint32_t recipientDeviceId) const

Searches for an OMEMO envelope by its recipientJid (bare JID of the recipient) and recipientDeviceId (ID of the recipient's device).

Returns the found OMEMO envelope.

uint32_t QXmppOmemoElement::senderDeviceId() const

Returns the ID of the sender's device.

The ID is 0 if it is unset.

See also setSenderDeviceId().

void QXmppOmemoElement::setPayload(const QByteArray &payload)

Sets the encrypted payload which consists of the encrypted SCE envelope.

See also payload().

void QXmppOmemoElement::setSenderDeviceId(uint32_t id)

Sets the id of the sender's device.

The ID must be at least 1 and at most std::numeric_limits<int32_t>::max().

See also senderDeviceId().