QXmpp: QXmppMessageReaction Class Reference

QXmpp Version: 1.14.2

Loading...
Searching...
No Matches
QXmppMessageReaction Class Reference

The QXmppMessageReaction class represents a reaction to a message in the form of emojis as specified by XEP-0444: Message Reactions. More...

## Public Member Functions
| QXmppMessageReaction ()
QString | messageId () const
void | setMessageId (const QString &messageId)
QVector< QString > | emojis () const
void | setEmojis (const QVector< QString > &emojis)

## Static Public Member Functions
static bool | isMessageReaction (const QDomElement &element)

## Detailed Description

The QXmppMessageReaction class represents a reaction to a message in the form of emojis as specified by XEP-0444: Message Reactions.

Since
  QXmpp 1.5

## Constructor & Destructor Documentation

## ◆ QXmppMessageReaction()

QXmppMessageReaction::QXmppMessageReaction | ( |  | ) |

Constructs a message reaction.

## Member Function Documentation

## ◆ emojis()

QVector< QString > QXmppMessageReaction::emojis | ( |  | ) | const

Returns the emojis in reaction to a message.

Returns
  the emoji reactions

## ◆ isMessageReaction()

bool QXmppMessageReaction::isMessageReaction | ( | const QDomElement & | element | ) |
| static

Determines whether the given DOM element is a message reaction element.

Parameters

  element | DOM element being checked

Returns
  true if element is a message reaction element, otherwise false

## ◆ messageId()

QString QXmppMessageReaction::messageId | ( |  | ) | const

Returns the ID of the message for that the reaction is sent.

For a group chat message,

QXmppMessage::stanzaId()
QXmppMessage::stanzaId
QString stanzaId() const
Definition QXmppMessage.cpp:928

is used.

For other message types,

QXmppMessage::originId()
QXmppMessage::originId
QString originId() const
Definition QXmppMessage.cpp:1006

is used. If that is not available,

QXmppMessage::id()
QXmppStanza::id
QString id() const
Definition QXmppStanza.cpp:750

is used.

Returns
  the message's ID

## ◆ setEmojis()

void QXmppMessageReaction::setEmojis | ( | const QVector< QString > & | emojis | ) |

Sets the emojis in reaction to a message.

Each reaction should only consist of unicode codepoints that can be displayed as a single emoji. Duplicates are not allowed.

Parameters

  emojis | emoji reactions

## ◆ setMessageId()

void QXmppMessageReaction::setMessageId | ( | const QString & | messageId | ) |

Sets the ID of the message for that the reaction is sent.

For a group chat message,

QXmppMessage::stanzaId()

must be used. If there is no such ID, a message reaction must not be sent.

For other message types,

QXmppMessage::originId()

should be used. If that is not available,

QXmppMessage::id()

should be used.

Parameters

  messageId | message's ID

The documentation for this class was generated from the following files:

- QXmppMessageReaction.h
- QXmppMessageReaction.cpp