Skip to main content

onMessageReactionReceived

Triggered when a user reacts to a message.
Reactions are usually emojis, following the current UI and UX design, but Apps can also use any string as a reaction.
Multiple reactions can be added to a message and removed from them at any time.

Received properties

In addition to the Base properties, a WireMessage.Reaction object includes:

  • messageId — Identifier of the message the reactions apply to.
  • emojiSet — Set of strings representing the sender’s reactions to the message.
    If empty, all previously added reactions by the same sender are removed.

Sample usage

Mirror user’s reaction

override suspend fun onMessageReactionReceived(wireMessage: WireMessage.Reaction) {
val reaction = WireMessage.Reaction.create(
conversationId = wireMessage.conversationId,
messageId = wireMessage.messageId,
emojiSet = wireMessage.emojiSet
)
manager.sendMessageSuspending(reaction)
}