QXmppMessageRetracted Class

The QXmppMessageRetracted class represents a retracted-message tombstone as defined by XEP-0424: Message Retraction. More...

Header: #include <QXmppMessageRetraction.h>
Since: QXmpp 1.17

Public Functions

QXmppMessageRetracted()
QString by() const
const std::optional<QXmppMessageModeration> &moderation() const
(since QXmpp 1.18) QString reason() const
(since QXmpp 1.18) QString retractionId() const
void setBy(const QString &by)
void setModeration(const std::optional<QXmppMessageModeration> &moderation)
(since QXmpp 1.18) void setReason(const QString &reason)
(since QXmpp 1.18) void setRetractionId(const QString &id)
void setStamp(const QDateTime &stamp)
QDateTime stamp() const

Detailed Description

Archiving services (XEP-0313: Message Archive Management) replace the body of a retracted message with a <retracted/> tombstone. It references the retraction message and records when the message was retracted, optionally why and, for XEP-0425: Moderated Message Retraction, by whom.

If the retracted message has been corrected (XEP-0308: Last Message Correction), the original message and each correction are replaced by a tombstone. The tombstones of the corrections keep their <replace/> element (QXmppMessage::replaceId()), so that they can be shown as a single retracted message.

Member Function Documentation

[noexcept default] QXmppMessageRetracted::QXmppMessageRetracted()

Default-constructs an instance of QXmppMessageRetracted.

QString QXmppMessageRetracted::by() const

Returns the optional JID of the entity that retracted the message.

See also setBy().

const std::optional<QXmppMessageModeration> &QXmppMessageRetracted::moderation() const

Returns the moderation information, set only for XEP-0425: Moderated Message Retraction tombstones.

See also setModeration().

[since QXmpp 1.18] QString QXmppMessageRetracted::reason() const

Returns the optional human-readable reason of the retraction, copied from the retraction message.

This function was introduced in QXmpp 1.18.

See also setReason().

[since QXmpp 1.18] QString QXmppMessageRetracted::retractionId() const

Returns the id of the retraction message, which is stored in the archive as well.

This function was introduced in QXmpp 1.18.

See also setRetractionId().

void QXmppMessageRetracted::setBy(const QString &by)

Sets the optional JID by of the entity that retracted the message.

See also by().

void QXmppMessageRetracted::setModeration(const std::optional<QXmppMessageModeration> &moderation)

Sets the moderation information for a XEP-0425: Moderated Message Retraction tombstone.

See also moderation().

[since QXmpp 1.18] void QXmppMessageRetracted::setReason(const QString &reason)

Sets the optional human-readable reason of the retraction.

This function was introduced in QXmpp 1.18.

See also reason().

[since QXmpp 1.18] void QXmppMessageRetracted::setRetractionId(const QString &id)

Sets the id of the retraction message.

This function was introduced in QXmpp 1.18.

See also retractionId().

void QXmppMessageRetracted::setStamp(const QDateTime &stamp)

Sets the timestamp stamp at which the message was retracted.

See also stamp().

QDateTime QXmppMessageRetracted::stamp() const

Returns the timestamp at which the message was retracted.

See also setStamp().