QXmpp
Version:1.2.0
|
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 } |
This enum describes a chat marker as defined by XEP-0333: Chat Markers. | |
enum | Hint { NoPermanentStore = 1 << 0, NoStore = 1 << 1, NoCopy = 1 << 2, Store = 1 << 3 } |
enum | EncryptionMethod { NoEncryption, UnknownEncryption, OTR, LegacyOpenPGP, OX, OMEMO } |
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 & | operator= (const QXmppMessage &other) |
Assigns other to this message. | |
bool | isXmppStanza () const override |
QString | body () const |
Returns the message's body. | |
void | setBody (const QString &) |
bool | isAttentionRequested () const |
void | setAttentionRequested (bool requested) |
bool | isReceiptRequested () const |
void | setReceiptRequested (bool requested) |
QString | mucInvitationJid () const |
void | setMucInvitationJid (const QString &jid) |
QString | mucInvitationPassword () const |
void | setMucInvitationPassword (const QString &password) |
QString | mucInvitationReason () const |
void | setMucInvitationReason (const QString &reason) |
QString | receiptId () const |
void | setReceiptId (const QString &id) |
QDateTime | stamp () const |
Returns the message's timestamp (if any). | |
void | setStamp (const QDateTime &stamp) |
QXmppMessage::State | state () const |
void | setState (QXmppMessage::State) |
QString | subject () const |
Returns the message's subject. | |
void | setSubject (const QString &) |
QString | thread () const |
Returns the message's thread. | |
void | setThread (const QString &) |
QXmppMessage::Type | type () const |
Returns the message's type. | |
void | setType (QXmppMessage::Type) |
QString | xhtml () const |
void | setXhtml (const QString &xhtml) |
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) |
QXmppBitsOfBinaryDataList | bitsOfBinaryData () const |
QXmppBitsOfBinaryDataList & | bitsOfBinaryData () |
void | setBitsOfBinaryData (const QXmppBitsOfBinaryDataList &bitsOfBinaryData) |
bool | isPrivate () const |
void | setPrivate (const bool) |
QString | outOfBandUrl () const |
Returns a possibly attached URL from XEP-0066: Out of Band Data. | |
void | setOutOfBandUrl (const QString &) |
Sets the attached URL for XEP-0066: Out of Band Data. | |
QString | replaceId () const |
void | setReplaceId (const QString &) |
bool | hasHint (const Hint hint) const |
void | addHint (const Hint hint) |
void | removeHint (const Hint hint) |
void | removeAllHints () |
QString | attachId () const |
void | setAttachId (const QString &) |
QString | mixUserJid () const |
void | setMixUserJid (const QString &) |
QString | mixUserNick () const |
void | setMixUserNick (const QString &) |
EncryptionMethod | encryptionMethod () const |
void | setEncryptionMethod (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 &) |
![]() | |
QXmppStanza (const QString &from=QString(), const QString &to=QString()) | |
QXmppStanza (const QXmppStanza &other) | |
Constructs a copy of other. | |
virtual | ~QXmppStanza () |
Destroys a QXmppStanza. | |
QXmppStanza & | operator= (const QXmppStanza &other) |
Assigns other to this stanza. | |
QString | to () const |
void | setTo (const QString &) |
QString | from () const |
Returns the stanza's sender JID. | |
void | setFrom (const QString &) |
QString | id () const |
Returns the stanza's identifier. | |
void | setId (const QString &) |
QString | lang () const |
Returns the stanza's language. | |
void | setLang (const QString &) |
QXmppStanza::Error | error () const |
Returns the stanza's error. | |
void | setError (const QXmppStanza::Error &error) |
QXmppElementList | extensions () const |
void | setExtensions (const QXmppElementList &elements) |
QList< QXmppExtendedAddress > | extendedAddresses () const |
void | setExtendedAddresses (const QList< QXmppExtendedAddress > &extendedAddresses) |
The QXmppMessage class represents an XMPP message.
This enum describes different end-to-end encryption methods. These can be used to mark a message explicitly as encrypted with a specific algothim. See XEP-0380: Explicit Message Encryption for details.
enum QXmppMessage::Hint |
enum QXmppMessage::State |
This enum describes a chat state as defined by XEP-0085: Chat State Notifications.
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.
QXmppMessage::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.
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::isMarkable | ( | ) | const |
Returns true if a message is markable, as defined 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::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 QXmppStanza.
QString QXmppMessage::markedId | ( | ) | const |
Returns the message's marker id, as defined XEP-0333: Chat Markers.
QString QXmppMessage::markedThread | ( | ) | const |
Returns the message's marker thread, as defined XEP-0333: Chat Markers.
QXmppMessage::Marker QXmppMessage::marker | ( | ) | const |
Returns the message's marker, as defined XEP-0333: Chat Markers.
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::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.
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.
param requested
void QXmppMessage::setBitsOfBinaryData | ( | const QXmppBitsOfBinaryDataList & | bitsOfBinaryData | ) |
Sets a list of XEP-0231: Bits of Binary attachments to be included.
void QXmppMessage::setBody | ( | const QString & | body | ) |
Sets the message's body.
body |
void QXmppMessage::setEncryptionMethod | ( | QXmppMessage::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::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::setMarkable | ( | const bool | markable | ) |
Sets if the message is markable, as defined XEP-0333: Chat Markers.
void QXmppMessage::setMarkedThread | ( | const QString & | markedThread | ) |
Sets the message's marked thread, as defined XEP-0333: Chat Markers.
void QXmppMessage::setMarker | ( | const Marker | marker | ) |
Sets the message's marker, as defined XEP-0333: Chat Markers
void QXmppMessage::setMarkerId | ( | const QString & | markerId | ) |
Sets the message's marker id, as defined XEP-0333: Chat Markers.
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::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::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.
param requested
void QXmppMessage::setReplaceId | ( | const QString & | replaceId | ) |
Sets the message id to replace with this message as in XEP-0308: Last Message Correction.
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.
stamp |
void QXmppMessage::setState | ( | QXmppMessage::State | state | ) |
Sets the message's chat state.
state |
void QXmppMessage::setSubject | ( | const QString & | subject | ) |
Sets the message's subject.
subject |
void QXmppMessage::setThread | ( | const QString & | thread | ) |
Sets the message's thread.
thread |
void QXmppMessage::setType | ( | QXmppMessage::Type | type | ) |
Sets the message's type.
type |
void QXmppMessage::setXhtml | ( | const QString & | xhtml | ) |
Sets the message's XHTML body as defined by XEP-0071: XHTML-IM.
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.
QXmppMessage::State QXmppMessage::state | ( | ) | const |
Returns the message's chat state.
QString QXmppMessage::xhtml | ( | ) | const |
Returns the message's XHTML body as defined by XEP-0071: XHTML-IM.