|
QXmpp Version: 1.15.1
|
The QXmppMessage class represents an XMPP message. More...
#include <QXmppMessage.h>


Public Types | |
| enum | Type { Error = 0 , Normal , Chat , GroupChat , Headline } |
| This enum describes a message type. | |
| enum | State { None = 0 , Active , Inactive , Gone , Composing , Paused } |
| enum | Marker { NoMarker = 0 , Received , Displayed , Acknowledged } |
| enum | Hint { NoPermanentStore = 1 << 0 , NoStore = 1 << 1 , NoCopy = 1 << 2 , Store = 1 << 3 } |
Public Member Functions | |
| QXmppMessage (const QString &from=QString(), const QString &to=QString(), const QString &body=QString(), const QString &thread=QString()) | |
| QXmppMessage (const QXmppMessage &other) | |
| Constructs a copy of other. | |
| QXmppMessage (QXmppMessage &&) | |
| Move-constructor. | |
| QXmppMessage & | operator= (const QXmppMessage &other) |
| Assignment operator. | |
| QXmppMessage & | operator= (QXmppMessage &&) |
| Move-assignment operator. | |
| bool | isXmppStanza () const override |
| QString | body () const |
| Returns the message's body. | |
| void | setBody (const QString &) |
| Sets the message's body. | |
| QString | e2eeFallbackBody () const |
| void | setE2eeFallbackBody (const QString &fallbackBody) |
| QString | subject () const |
| Returns the message's subject. | |
| void | setSubject (const QString &) |
| Sets the message's subject. | |
| QString | thread () const |
| Returns the message's thread. | |
| void | setThread (const QString &) |
| Sets the message's thread. | |
| QString | parentThread () const |
| void | setParentThread (const QString &) |
| QXmppMessage::Type | type () const |
| Returns the message's type. | |
| void | setType (QXmppMessage::Type) |
| Sets the message's type. | |
| QString | outOfBandUrl () const |
| void | setOutOfBandUrl (const QString &) |
| QVector< QXmppOutOfBandUrl > | outOfBandUrls () const |
| void | setOutOfBandUrls (const QVector< QXmppOutOfBandUrl > &urls) |
| QString | xhtml () const |
| void | setXhtml (const QString &xhtml) |
| QXmppMessage::State | state () const |
| void | setState (QXmppMessage::State) |
| QDateTime | stamp () const |
| void | setStamp (const QDateTime &stamp) |
| bool | isReceiptRequested () const |
| void | setReceiptRequested (bool requested) |
| QString | receiptId () const |
| void | setReceiptId (const QString &id) |
| bool | isAttentionRequested () const |
| void | setAttentionRequested (bool requested) |
| QXmppBitsOfBinaryDataList | bitsOfBinaryData () const |
| QXmppBitsOfBinaryDataList & | bitsOfBinaryData () |
| void | setBitsOfBinaryData (const QXmppBitsOfBinaryDataList &bitsOfBinaryData) |
| bool | isSlashMeCommand () const |
| QString | slashMeCommandText () const |
| QString | mucInvitationJid () const |
| void | setMucInvitationJid (const QString &jid) |
| QString | mucInvitationPassword () const |
| void | setMucInvitationPassword (const QString &password) |
| QString | mucInvitationReason () const |
| void | setMucInvitationReason (const QString &reason) |
| bool | isPrivate () const |
| void | setPrivate (const bool) |
| bool | isCarbonForwarded () const |
| void | setCarbonForwarded (bool) |
| QString | replaceId () const |
| void | setReplaceId (const QString &) |
| bool | isMarkable () const |
| void | setMarkable (const bool) |
| QString | markedId () const |
| void | setMarkerId (const QString &) |
| QString | markedThread () const |
| void | setMarkedThread (const QString &) |
| Marker | marker () const |
| void | setMarker (const Marker) |
| bool | hasHint (const Hint hint) const |
| void | addHint (const Hint hint) |
| void | removeHint (const Hint hint) |
| void | removeAllHints () |
| std::optional< QXmppJingleMessageInitiationElement > | jingleMessageInitiationElement () const |
| void | setJingleMessageInitiationElement (const std::optional< QXmppJingleMessageInitiationElement > &jingleMessageInitiationElement) |
| QString | stanzaId () const |
| void | setStanzaId (const QString &id) |
| QString | stanzaIdBy () const |
| void | setStanzaIdBy (const QString &id) |
| QVector< QXmppStanzaId > | stanzaIds () const |
| void | setStanzaIds (const QVector< QXmppStanzaId > &) |
| QString | originId () const |
| void | setOriginId (const QString &id) |
| QString | attachId () const |
| void | setAttachId (const QString &) |
| QString | mixParticipantId () const |
| QString | mixUserJid () const |
| void | setMixUserJid (const QString &) |
| QString | mixUserNick () const |
| void | setMixUserNick (const QString &) |
| QXmpp::EncryptionMethod | encryptionMethod () const |
| void | setEncryptionMethod (QXmpp::EncryptionMethod) |
| QString | encryptionMethodNs () const |
| void | setEncryptionMethodNs (const QString &) |
| QString | encryptionName () const |
| void | setEncryptionName (const QString &) |
| bool | isSpoiler () const |
| void | setIsSpoiler (bool) |
| QString | spoilerHint () const |
| void | setSpoilerHint (const QString &) |
| std::optional< QXmppMixInvitation > | mixInvitation () const |
| void | setMixInvitation (const std::optional< QXmppMixInvitation > &mixInvitation) |
| QString | mucOccupantId () const |
| void | setMucOccupantId (const QString &occupantId) |
| bool | isFallback () const |
| void | setIsFallback (bool isFallback) |
| const QVector< QXmppFallback > & | fallbackMarkers () const |
| void | setFallbackMarkers (const QVector< QXmppFallback > &) |
| QString | readFallbackRemovedText (QXmppFallback::Element element, const QVector< QString > &supportedNamespaces) const |
| QString | readFallbackText (QXmppFallback::Element element, QStringView forNamespace) const |
| std::optional< QXmppTrustMessageElement > | trustMessageElement () const |
| void | setTrustMessageElement (const std::optional< QXmppTrustMessageElement > &trustMessageElement) |
| std::optional< QXmppMessageReaction > | reaction () const |
| void | setReaction (const std::optional< QXmppMessageReaction > &reaction) |
| const QVector< QXmppFileShare > & | sharedFiles () const |
| void | setSharedFiles (const QVector< QXmppFileShare > &sharedFiles) |
| QVector< QXmppFileSourcesAttachment > | fileSourcesAttachments () const |
| void | setFileSourcesAttachments (const QVector< QXmppFileSourcesAttachment > &) |
| std::optional< QXmpp::Reply > | reply () const |
| void | setReply (const std::optional< QXmpp::Reply > &) |
| QString | readReplyQuoteFromBody () const |
| std::optional< QXmppCallInviteElement > | callInviteElement () const |
| void | setCallInviteElement (std::optional< QXmppCallInviteElement > callInviteElement) |
| void | parseExtensions (const QDomElement &element, QXmpp::SceMode sceMode) |
| virtual bool | parseExtension (const QDomElement &element, QXmpp::SceMode) |
| virtual void | serializeExtensions (QXmlStreamWriter *writer, QXmpp::SceMode, const QString &baseNamespace={}) const |
Public Member Functions inherited from QXmppStanza | |
| QXmppStanza (const QString &from=QString(), const QString &to=QString()) | |
| QXmppStanza (const QXmppStanza &other) | |
| Constructs a copy of other. | |
| QXmppStanza (QXmppStanza &&) | |
| Move constructor. | |
| ~QXmppStanza () override | |
| Destroys a QXmppStanza. | |
| QXmppStanza & | operator= (const QXmppStanza &other) |
| Assigns other to this stanza. | |
| QXmppStanza & | operator= (QXmppStanza &&) |
| Move-assignment operator. | |
| QString | to () const |
| void | setTo (const QString &) |
| QString | from () const |
| void | setFrom (const QString &) |
| QString | id () const |
| void | setId (const QString &) |
| QString | lang () const |
| void | setLang (const QString &) |
| QXmppStanza::Error | error () const |
| std::optional< Error > | errorOptional () const |
| void | setError (const QXmppStanza::Error &error) |
| void | setError (const std::optional< Error > &error) |
| QXmppElementList | extensions () const |
| void | setExtensions (const QXmppElementList &elements) |
| QList< QXmppExtendedAddress > | extendedAddresses () const |
| void | setExtendedAddresses (const QList< QXmppExtendedAddress > &extendedAddresses) |
| std::optional< QXmppE2eeMetadata > | e2eeMetadata () const |
| void | setE2eeMetadata (const std::optional< QXmppE2eeMetadata > &e2eeMetadata) |
Public Member Functions inherited from QXmppNonza | |
| virtual void | parse (const QDomElement &)=0 |
| virtual void | toXml (QXmlStreamWriter *writer) const =0 |
Static Public Member Functions | |
| static bool | isSlashMeCommand (const QString &body) |
| static QString | slashMeCommandText (const QString &body) |
The QXmppMessage class represents an XMPP message.
| enum QXmppMessage::Hint |
XEP-0334: Message Processing Hints
| Enumerator | |
|---|---|
| NoPermanentStore | Do not allow permanent storage. |
| NoStore | Do not store at all. |
| NoCopy | Do not copy the message. |
| Store | Do store the message. |
| enum QXmppMessage::Marker |
This enum describes a chat marker as defined by XEP-0333: Chat Markers.
| enum QXmppMessage::State |
This enum describes a chat state as defined by <a href="https://xmpp.org/extensions/xep-0085.html">XEP-0085: Chat State
Notifications.
\since QXmpp 0.2
| QXmppMessage::QXmppMessage | ( | const QString & | from = QString(), |
| const QString & | to = QString(), |
||
| const QString & | body = QString(), |
||
| const QString & | thread = QString() |
||
| ) |
Constructs a QXmppMessage.
| from | |
| to | |
| body | |
| thread |
| void QXmppMessage::addHint | ( | const Hint | hint | ) |
Adds a hint to the message, as defined in XEP-0334: Message Processing Hints
| QString QXmppMessage::attachId | ( | ) | const |
Returns the message id this message is linked/attached to. See XEP-0367: Message Attaching for details.
| QXmppBitsOfBinaryDataList & QXmppMessage::bitsOfBinaryData | ( | ) |
Returns a list of data attached using XEP-0231: Bits of Binary.
This could be used to resolve cid: URIs found in the X-HTML body.
| QXmppBitsOfBinaryDataList QXmppMessage::bitsOfBinaryData | ( | ) | const |
Returns a list of data packages attached using XEP-0231: Bits of Binary.
This could be used to resolve cid: URIs found in the X-HTML body.
| std::optional< QXmppCallInviteElement > QXmppMessage::callInviteElement | ( | ) | const |
Returns a Call Invite element as defined in XEP-0482: Call Invites.
| QString QXmppMessage::e2eeFallbackBody | ( | ) | const |
Returns a body that is unlike the normal body not encrypted.
It can be presented to users if the message could not be decrypted (e.g., because their clients do not support the used end-to-end encryption).
| QXmpp::EncryptionMethod QXmppMessage::encryptionMethod | ( | ) | const |
Returns the encryption method this message is advertised to be encrypted with.
encryptionMethodNs() and possibly also a name with encryptionName().| QString QXmppMessage::encryptionMethodNs | ( | ) | const |
Returns the namespace of the advertised encryption method via. XEP-0380: Explicit Message Encryption.
| QString QXmppMessage::encryptionName | ( | ) | const |
Returns the associated name of the encryption method this message advertises to be encrypted with. See XEP-0380: Explicit Message Encryption for details.
| const QVector< QXmppFallback > & QXmppMessage::fallbackMarkers | ( | ) | const |
Returns the fallback elements defined in XEP-0428: Fallback Indication.
| QVector< QXmppFileSourcesAttachment > QXmppMessage::fileSourcesAttachments | ( | ) | const |
Returns additional sources to be attached to a file share as defined by XEP-0447: Stateless file sharing.
| bool QXmppMessage::hasHint | ( | const Hint | hint | ) | const |
Returns true if the message contains the hint passed, as defined in XEP-0334: Message Processing Hints
| bool QXmppMessage::isAttentionRequested | ( | ) | const |
Returns true if the user's attention is requested, as defined by XEP-0224: Attention.
| bool QXmppMessage::isCarbonForwarded | ( | ) | const |
Returns whether this message has been forwarded using carbons.
| bool QXmppMessage::isFallback | ( | ) | const |
Sets whether this message is only a fallback according to XEP-0428: Fallback Indication.
This is useful for clients not supporting end-to-end encryption to indicate that the message body does not contain the intended text of the author.
| bool QXmppMessage::isMarkable | ( | ) | const |
Returns true if a message is markable, as defined by XEP-0333: Chat Markers.
| bool QXmppMessage::isPrivate | ( | ) | const |
Returns if the message is marked with a <private/> tag, in which case it will not be forwarded to other resources according to XEP-0280: Message Carbons.
| bool QXmppMessage::isReceiptRequested | ( | ) | const |
Returns true if a delivery receipt is requested, as defined by XEP-0184: Message Delivery Receipts.
| bool QXmppMessage::isSlashMeCommand | ( | ) | const |
Returns whether the body of the message is a '/me command' as defined in XEP-0245: The /me Command.
|
static |
Returns whether the given text is a '/me command' as defined in XEP-0245: The /me Command.
| bool QXmppMessage::isSpoiler | ( | ) | const |
Returns true, if this is a spoiler message according to XEP-0382: Spoiler Messages. The spoiler hint however can still be empty.
A spoiler message's content should not be visible to the user by default.
|
overridevirtual |
Indicates if the QXmppStanza is a stanza in the XMPP sense (i. e. a message, iq or presence)
Reimplemented from QXmppNonza.
| std::optional< QXmppJingleMessageInitiationElement > QXmppMessage::jingleMessageInitiationElement | ( | ) | const |
Returns a Jingle Message Initiation element as defined in XEP-0353: Jingle Message Initiation.
| QString QXmppMessage::markedId | ( | ) | const |
Returns the message's marker id, as defined by XEP-0333: Chat Markers.
| QString QXmppMessage::markedThread | ( | ) | const |
Returns the message's marker thread, as defined by XEP-0333: Chat Markers.
| QXmppMessage::Marker QXmppMessage::marker | ( | ) | const |
Returns the message's marker, as defined by XEP-0333: Chat Markers.
| std::optional< QXmppMixInvitation > QXmppMessage::mixInvitation | ( | ) | const |
Returns an included XEP-0369: Mediated Information eXchange (MIX) invitation as defined by XEP-0407: Mediated Information eXchange (MIX): Miscellaneous Capabilities.
| QString QXmppMessage::mixParticipantId | ( | ) | const |
Returns the participant ID of the sender if the message is received from a MIX channel as specified in XEP-0369: Mediated Information eXchange (MIX).
| QString QXmppMessage::mixUserJid | ( | ) | const |
Returns the actual JID of a MIX channel participant.
| QString QXmppMessage::mixUserNick | ( | ) | const |
Returns the MIX participant's nickname.
| QString QXmppMessage::mucInvitationJid | ( | ) | const |
Returns the JID for a multi-user chat direct invitation as defined by XEP-0249: Direct MUC Invitations.
| QString QXmppMessage::mucInvitationPassword | ( | ) | const |
Returns the password for a multi-user chat direct invitation as defined by XEP-0249: Direct MUC Invitations.
| QString QXmppMessage::mucInvitationReason | ( | ) | const |
Returns the reason for a multi-user chat direct invitation as defined by XEP-0249: Direct MUC Invitations.
| QString QXmppMessage::mucOccupantId | ( | ) | const |
Returns the MUC Occupant ID as defined in XEP-0421: Occupant identifiers for semi-anonymous MUCs.
| QString QXmppMessage::originId | ( | ) | const |
Returns the origin ID of the message according to XEP-0359: Unique and Stable Stanza IDs.
| QString QXmppMessage::outOfBandUrl | ( | ) | const |
Returns a possibly attached URL from XEP-0066: Out of Band Data
| QVector< QXmppOutOfBandUrl > QXmppMessage::outOfBandUrls | ( | ) | const |
Returns possibly attached URLs from XEP-0066: Out of Band Data
| QString QXmppMessage::parentThread | ( | ) | const |
Returns the optional parent thread of this message.
The possibility to create child threads was added in RFC6121.
|
virtual |
Parses a child element of the message stanza.
Allows inherited classes to parse additional extension elements. This function may be executed multiple times with different elements.
| element | child element of the message to be parsed |
| sceMode | Which elements to be parsed from the DOM (all known / only public / only sensitive) |
| void QXmppMessage::parseExtensions | ( | const QDomElement & | element, |
| QXmpp::SceMode | sceMode | ||
| ) |
Parses all child elements of a message stanza.
| element | message element or SCE content element |
| sceMode | mode to decide which child elements of the message to parse |
| std::optional< QXmppMessageReaction > QXmppMessage::reaction | ( | ) | const |
Returns a reaction to a message as defined by XEP-0444: Message Reactions.
| QString QXmppMessage::readFallbackRemovedText | ( | QXmppFallback::Element | element, |
| const QVector< QString > & | supportedNamespaces | ||
| ) | const |
Returns the body or subject text of the message without parts that have a fallback marker with a supported namespace.
| element | whether to use the body or the subject text |
| supportedNamespaces |
| QString QXmppMessage::readFallbackText | ( | QXmppFallback::Element | element, |
| QStringView | forNamespace | ||
| ) | const |
Returns the parts of the body or subject that are marked as fallback for this namespace.
| element | whether to use the body or the subject text |
| forNamespace |
| QString QXmppMessage::readReplyQuoteFromBody | ( | ) | const |
Returns the part of the body that is marked as fallback for XEP-0461: Message Replies, without any quotation marks ('> ').
| QString QXmppMessage::receiptId | ( | ) | const |
If this message is a delivery receipt, returns the ID of the original message.
| void QXmppMessage::removeAllHints | ( | ) |
Removes all hints from the message, as defined in XEP-0334: Message Processing Hints
| void QXmppMessage::removeHint | ( | const Hint | hint | ) |
Removes a hint from the message, as defined in XEP-0334: Message Processing Hints
| QString QXmppMessage::replaceId | ( | ) | const |
Returns the message id to replace with this message as used in XEP-0308: Last Message Correction. If the returned string is empty, this message is not replacing another.
| std::optional< QXmpp::Reply > QXmppMessage::reply | ( | ) | const |
Returns the message reply extension as defined in XEP-0461: Message Replies.
|
virtual |
Serializes all additional child elements.
| writer | The XML stream writer to output the XML |
| sceMode | The mode which decides which elements to output (only useful for encryption) |
| baseNamespace | Custom namespace added to basic XMPP-Core elements like <body/> (needed when encrypting elements outside of the stream). |
| void QXmppMessage::setAttachId | ( | const QString & | attachId | ) |
Sets the id of the attached message as in XEP-0367: Message Attaching. This can be used for a "reply to" or "reaction" function.
The used message id depends on the message context, see the Business rules section of the XEP for details about when to use which id.
| void QXmppMessage::setAttentionRequested | ( | bool | requested | ) |
Sets whether the user's attention is requested, as defined by XEP-0224: Attention.
| requested | Whether to request attention (true) or not (false) |
| void QXmppMessage::setBitsOfBinaryData | ( | const QXmppBitsOfBinaryDataList & | bitsOfBinaryData | ) |
Sets a list of XEP-0231: Bits of Binary attachments to be included.
| void QXmppMessage::setCallInviteElement | ( | std::optional< QXmppCallInviteElement > | callInviteElement | ) |
Sets a Call Invite element as defined in XEP-0482: Call Invites.
| void QXmppMessage::setCarbonForwarded | ( | bool | forwarded | ) |
Sets whether this message has been forwarded using carbons.
Setting this to true has no effect, this is purely informational.
| void QXmppMessage::setE2eeFallbackBody | ( | const QString & | fallbackBody | ) |
Sets a body that is unlike the normal body not encrypted.
It can be presented to users if the message could not be decrypted (e.g., because their clients do not support the used end-to-end encryption).
| fallbackBody | end-to-end encryption fallback body |
| void QXmppMessage::setEncryptionMethod | ( | QXmpp::EncryptionMethod | method | ) |
Advertises that this message is encrypted with the given encryption method. See XEP-0380: Explicit Message Encryption for details.
| void QXmppMessage::setEncryptionMethodNs | ( | const QString & | encryptionMethod | ) |
Sets the namespace of the encryption method this message advertises to be encrypted with. See XEP-0380: Explicit Message Encryption for details.
| void QXmppMessage::setEncryptionName | ( | const QString & | encryptionName | ) |
Sets the name of the encryption method for XEP-0380: Explicit Message Encryption.
| void QXmppMessage::setFallbackMarkers | ( | const QVector< QXmppFallback > & | fallbackMarkers | ) |
Sets the fallback elements defined in XEP-0428: Fallback Indication.
| void QXmppMessage::setFileSourcesAttachments | ( | const QVector< QXmppFileSourcesAttachment > & | fileSourcesAttachments | ) |
Sets additional sources to be attached to a file share as defined by XEP-0447: Stateless file sharing.
| void QXmppMessage::setIsFallback | ( | bool | isFallback | ) |
Sets whether this message is only a fallback according to XEP-0428: Fallback Indication.
This is useful for clients not supporting end-to-end encryption to indicate that the message body does not contain the intended text of the author.
| void QXmppMessage::setIsSpoiler | ( | bool | isSpoiler | ) |
Sets whether this is a spoiler message as specified in XEP-0382: Spoiler Messages.
The content of spoiler messages will not be displayed by default to the user. However, clients not supporting spoiler messages will still display the content as usual.
| void QXmppMessage::setJingleMessageInitiationElement | ( | const std::optional< QXmppJingleMessageInitiationElement > & | jingleMessageInitiationElement | ) |
Sets a Jingle Message Initiation element as defined in XEP-0353: Jingle Message Initiation.
| void QXmppMessage::setMarkable | ( | const bool | markable | ) |
Sets if the message is markable, as defined by XEP-0333: Chat Markers.
| void QXmppMessage::setMarkedThread | ( | const QString & | markedThread | ) |
Sets the message's marked thread, as defined by XEP-0333: Chat Markers.
| void QXmppMessage::setMarker | ( | const Marker | marker | ) |
Sets the message's marker, as defined by XEP-0333: Chat Markers
| void QXmppMessage::setMarkerId | ( | const QString & | markerId | ) |
Sets the message's marker id, as defined by XEP-0333: Chat Markers.
| void QXmppMessage::setMixInvitation | ( | const std::optional< QXmppMixInvitation > & | mixInvitation | ) |
Sets a XEP-0369: Mediated Information eXchange (MIX) invitation as defined by XEP-0407: Mediated Information eXchange (MIX): Miscellaneous Capabilities.
| void QXmppMessage::setMixUserJid | ( | const QString & | mixUserJid | ) |
Sets the actual JID of a MIX channel participant.
| void QXmppMessage::setMixUserNick | ( | const QString & | mixUserNick | ) |
Sets the MIX participant's nickname.
| void QXmppMessage::setMucInvitationJid | ( | const QString & | jid | ) |
Sets the JID for a multi-user chat direct invitation as defined by XEP-0249: Direct MUC Invitations.
| void QXmppMessage::setMucInvitationPassword | ( | const QString & | password | ) |
Sets the password for a multi-user chat direct invitation as defined by XEP-0249: Direct MUC Invitations.
| void QXmppMessage::setMucInvitationReason | ( | const QString & | reason | ) |
Sets the reason for a multi-user chat direct invitation as defined by XEP-0249: Direct MUC Invitations.
| void QXmppMessage::setMucOccupantId | ( | const QString & | id | ) |
Sets the MUC Occupant ID as defined in XEP-0421: Occupant identifiers for semi-anonymous MUCs.
| void QXmppMessage::setOriginId | ( | const QString & | id | ) |
Sets the origin ID of the message according to XEP-0359: Unique and Stable Stanza IDs.
| void QXmppMessage::setOutOfBandUrl | ( | const QString & | url | ) |
Sets the attached URL for XEP-0066: Out of Band Data
This overrides all other urls that may be contained in the list of out of band urls.
| void QXmppMessage::setOutOfBandUrls | ( | const QVector< QXmppOutOfBandUrl > & | urls | ) |
Sets the attached URLs for XEP-0066: Out of Band Data
| void QXmppMessage::setParentThread | ( | const QString & | parent | ) |
Sets the optional parent thread of this message.
The possibility to create child threads was added in RFC6121.
| void QXmppMessage::setPrivate | ( | const bool | priv | ) |
If true is passed, the message is marked with a <private/> tag, in which case it will not be forwarded to other resources according to XEP-0280: Message Carbons.
| void QXmppMessage::setReaction | ( | const std::optional< QXmppMessageReaction > & | reaction | ) |
Sets a reaction to a message as defined by XEP-0444: Message Reactions.
The corresponding hint must be set manually:
| void QXmppMessage::setReceiptId | ( | const QString & | id | ) |
Make this message a delivery receipt for the message with the given id.
| void QXmppMessage::setReceiptRequested | ( | bool | requested | ) |
Sets whether a delivery receipt is requested, as defined by XEP-0184: Message Delivery Receipts.
| void QXmppMessage::setReplaceId | ( | const QString & | replaceId | ) |
Sets the message id to replace with this message as in XEP-0308: Last Message Correction.
| void QXmppMessage::setReply | ( | const std::optional< QXmpp::Reply > & | ) |
Sets the message reply extension as defined in XEP-0461: Message Replies.
| void QXmppMessage::setSharedFiles | ( | const QVector< QXmppFileShare > & | sharedFiles | ) |
Sets the via XEP-0447: Stateless file sharing shared files attached to this message.
| void QXmppMessage::setSpoilerHint | ( | const QString & | spoilerHint | ) |
Sets a spoiler hint for XEP-0382: Spoiler Messages. If the spoiler hint is not empty, isSpoiler will be set to true.
A spoiler hint is optional for spoiler messages.
Keep in mind that the spoiler hint is not displayed at all by clients not supporting spoiler messages.
| void QXmppMessage::setStamp | ( | const QDateTime & | stamp | ) |
Sets the message's timestamp without modifying the type of the stamp (XEP-0093: Legacy Delayed Delivery or XEP-0203: Delayed Delivery).
By default messages are constructed with the new delayed delivery XEP, but parsed messages keep their type.
| void QXmppMessage::setStanzaId | ( | const QString & | id | ) |
Sets the stanza ID of the message according to XEP-0359: Unique and Stable Stanza IDs.
| void QXmppMessage::setStanzaIdBy | ( | const QString & | by | ) |
Sets the creator of the stanza ID according to XEP-0359: Unique and Stable Stanza IDs.
| void QXmppMessage::setStanzaIds | ( | const QVector< QXmppStanzaId > & | ids | ) |
Sets the stanza IDs of the message as defined in XEP-0359: Unique and Stable Stanza IDs.
| void QXmppMessage::setState | ( | QXmppMessage::State | state | ) |
Sets the the chat state notification according to XEP-0085: Chat State Notifications.
| void QXmppMessage::setTrustMessageElement | ( | const std::optional< QXmppTrustMessageElement > & | trustMessageElement | ) |
Sets a trust message element as defined by XEP-0434: Trust Messages (TM).
| void QXmppMessage::setXhtml | ( | const QString & | xhtml | ) |
Sets the message's XHTML body as defined by XEP-0071: XHTML-IM.
| const QVector< QXmppFileShare > & QXmppMessage::sharedFiles | ( | ) | const |
Returns the via XEP-0447: Stateless file sharing shared files attached to this message.
| QString QXmppMessage::slashMeCommandText | ( | ) | const |
Returns the part of the body after the /me command.
This cuts off '/me ' (with the space) from the body, in case the body starts with that. In case the body does not contain a /me command as defined in XEP-0245: The /me Command, a null string is returned.
This is useful when displaying the /me command correctly to the user.
|
static |
Returns the part of the body after the /me command.
This cuts off '/me ' (with the space) from the body, in case the body starts with that. In case the body does not contain a /me command as defined in XEP-0245: The /me Command, a null string is returned.
This is useful when displaying the /me command correctly to the user.
| QString QXmppMessage::spoilerHint | ( | ) | const |
Returns the spoiler hint as specified in XEP-0382: Spoiler Messages.
The hint may be empty, even if isSpoiler is true.
| QDateTime QXmppMessage::stamp | ( | ) | const |
Returns the optional timestamp of the message specified using XEP-0093: Legacy Delayed Delivery or using XEP-0203: Delayed Delivery (preferred).
| QString QXmppMessage::stanzaId | ( | ) | const |
Returns the stanza ID of the message according to XEP-0359: Unique and Stable Stanza IDs.
| QString QXmppMessage::stanzaIdBy | ( | ) | const |
Returns the creator of the stanza ID according to XEP-0359: Unique and Stable Stanza IDs.
| QVector< QXmppStanzaId > QXmppMessage::stanzaIds | ( | ) | const |
Returns the stanza IDs of the message as defined in XEP-0359: Unique and Stable Stanza IDs.
| QXmppMessage::State QXmppMessage::state | ( | ) | const |
Returns the the chat state notification according to XEP-0085: Chat State Notifications.
| std::optional< QXmppTrustMessageElement > QXmppMessage::trustMessageElement | ( | ) | const |
Returns an included trust message element as defined by XEP-0434: Trust Messages (TM).
| QString QXmppMessage::xhtml | ( | ) | const |
Returns the message's XHTML body as defined by XEP-0071: XHTML-IM.