XEP-xxxx: Message Reactions

This specification defines a way for adding reactions to a message.
  • Natalie Wirth
  • Marvin Wissfeld
© 2019 – 2019 XMPP Standards Foundation. SEE LEGAL NOTICES.


WARNING: This document has not yet been accepted for consideration or approved in any official manner by the XMPP Standards Foundation, and this document is not yet an XMPP Extension Protocol (XEP). If this document is accepted as a XEP by the XMPP Council, it will be published at <https://xmpp.org/extensions/> and announced on the <standards@xmpp.org> mailing list.
Standards Track
0.0.1 (2019-07-14)
Document Lifecycle
  1. Experimental
  2. Proposed
  3. Stable
  4. Final

1. Introduction

Message reactions allow to express an opinion or feeling towards a message in a quick and light-weight way. Reactions are described in the form of emojis and can enhance communication especially when chatting with multiple parties. Other possible uses include voting and checking to-do list items.

Reactions are typically displayed in a summarizing fashion visually attached to the message they belong to.

Related work has been done in Message Attaching (XEP-0367) [1]. However, it can't be used for reactions, as it would cause difficulties with non-supporting clients, is not tailored to emojis and does not specify removal of reactions. To solve these issues, this XEP introduces a separate XML element for reactions.

2. Discovering support

If a client implements message reactions, it MUST specify the 'urn:xmpp:reactions:0' feature in its service discovery information features as specified in Service Discovery (XEP-0030) [2] and the Entity Capabilities profile specified in Entity Capabilities (XEP-0115) [3].

Example 1. Client requests information about a chat partner's client
<iq type='get'
  <query xmlns='http://jabber.org/protocol/disco#info'/>
Example 2. Partner's client advertises support for reactions
<iq type='result'
  <query xmlns='http://jabber.org/protocol/disco#info'>
    <feature var='urn:xmpp:reactions:0'/>

3. Use Cases

3.1 Sending reactions to a message

When a user chooses to react to a message with a certain emoji, the client sends a <message> stanza containing a <reactions> element. The chosen emoji is included in a <reaction> element within the <reactions> element. The message is referred to by including its id or in MUCs its stanza-id as defined in Unique and Stable Stanza IDs (XEP-0359) [4] in the 'id' attribute of the reactions element.

Example 3. Romeo sends a message
<message to='juliet@capulet.net/balcony' id='744f6e18-a57a-11e9-a656-4889e7820c76' type='chat'>
  <body>Hello, world!</body>
Example 4. Juliet sends a 👋 reaction to the message
<message to='romeo@capulet.net/orchard' id='7fdd29fa-a57a-11e9-b04a-4889e7820c76' type='chat'>
  <reactions id='744f6e18-a57a-11e9-a656-4889e7820c76' xmlns='urn:xmpp:reactions:0'>
  <store xmlns="urn:xmpp:hints"/>

3.2 Updating reactions to a message

If the user chooses to remove reactions from or add reactions to a message they have already reacted to, the client sends a <message> with all <reaction> elements that are (still or newly) applicable to that message.

Example 5. Juliet adds a 🐢 reaction to the message
<message to='romeo@capulet.net/orchard' id='96d73204-a57a-11e9-88b8-4889e7820c76' type='chat'>
  <reactions id='744f6e18-a57a-11e9-a656-4889e7820c76' xmlns='urn:xmpp:reactions:0'>
  <store xmlns="urn:xmpp:hints"/>

In order to remove all reactions from a message, an empty <reactions> element is sent.

Example 6. Juliet removes all reactions from the message
<message to='romeo@capulet.net/orchard' id='973c9d2e-a57a-11e9-af82-4889e7820c76' type='chat'>
  <reactions id='744f6e18-a57a-11e9-a656-4889e7820c76' xmlns='urn:xmpp:reactions:0'/>
  <store xmlns="urn:xmpp:hints"/>

4. Business Rules

Messages MUST NOT contain more then one <reactions> element

A message containing a <reactions> element SHOULD be of type 'chat' or 'groupchat'.

A <reaction> element SHOULD only contain Unicode codepoints that can be displayed as a single emoji, as specified in the latest revision of the Unicode® Technical Standard #51 [5]. Receiving entities MAY ignore <reaction> elements that do not comply with this specification.

A receiving client SHOULD show reactions attached to the message they where in response to. Reactions MAY be displayed in a summarized fashion.

A <reactions> element MUST NOT contain the same reaction more than once. A receiving entity SHOULD ignore duplicate reactions inside a <reactions> element.

The sending entity SHOULD add a <store/> hint, as defined in Message Processing Hints (XEP-0334) [6], if the message being reacted to does not carry a <no-store/> hint.

If a message is updated using Last Message Correction (XEP-0308) [7], the 'id' attribute of the <reactions> element SHOULD reference the original message id. A receiving entity SHOULD accept messages with a <reactions> element referencing a message correction and SHOULD handle such element as if it was using the message id of the original message.

4.1 Acceptable reactions

In direct conversations, a reaction MUST only be accepted if the senders bare JID matches the bare JID of any of the two involved parties.

In MUCs and MUC PMs, the recipient SHOULD ensure that the real bare JID of the sending occupant did not already send a reaction to that message to accept it as a new reaction, e.g. by keeping track of leave/join presences since the message was send. This implies that in semi-anonymous MUCs it MAY be impossible to attach reactions to a message received from the history. A reaction MAY still be a valid reaction update (as per the next paragraph) if it was not accepted as a new reaction.

A reaction MUST only be considered an update if it orignates from the same sender as a previous reaction message. In direct conversations, this means the bare JID MUST match the original bare JID. In MUCs and MUC PMs the senders full JID MAY not match the original full JID, but the recipient MUST ensure that the real bare JID of the sending occupant is the same as the real bare JID of the previous reaction message, e.g. by keeping track of leave/join presences.

If a message containing a <reactions> element arrives delayed, which means it carries a <delay/> element, as defined in Delayed Delivery (XEP-0203) [8] it SHOULD only be accepted, if no newer reaction from the same sender was already accepted.

4.2 Using the correct ID

For messages of type 'groupchat', the stanza's 'id' attribute MUST NOT be used for reactions. Instead, in group chat situations, the ID assigned to the stanza by the group chat itself must be used. This is discovered in a <stanza-id> element with a 'by' attribute that matches the bare JID of the group chat, as defined in Unique and Stable Stanza IDs (XEP-0359) [4].

This implies that group chat messages without a Unique and Stable Stanza IDs (XEP-0359) [4] stanza-id cannot be reacted to.

For other message types the sender should use the 'id' from a Unique and Stable Stanza IDs (XEP-0359) [4] <origin-id> if present, or the value of the 'id' attribute on the <message> otherwise.

5. IANA Considerations

This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [9].

6. XMPP Registrar Considerations

6.1 Protocol Namespaces

The XMPP Registrar [10] includes 'urn:xmpp:reactions:0' in its registry of protocol namespaces (see <https://xmpp.org/registrar/namespaces.html>).


Appendix A: Document Information

XMPP Standards Foundation
Standards Track
Last Updated
Approving Body
XMPP Council
XMPP Core, XEP-0001, XEP-0030, XEP-0115, XEP-0203, XEP-0334, XEP-0359
Superseded By
Short Name

This document in other formats: XML  PDF

Appendix B: Author Information

Natalie Wirth
Marvin Wissfeld


This XMPP Extension Protocol is copyright © 1999 – 2024 by the XMPP Standards Foundation (XSF).


Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.

Disclaimer of Warranty

## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##

Limitation of Liability

In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.

IPR Conformance

This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at <https://xmpp.org/about/xsf/ipr-policy> or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).

Visual Presentation

The HTML representation (you are looking at) is maintained by the XSF. It is based on the YAML CSS Framework, which is licensed under the terms of the CC-BY-SA 2.0 license.

Appendix D: Relation to XMPP

The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.

Appendix E: Discussion Venue

The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.

Discussion on other xmpp.org discussion lists might also be appropriate; see <https://xmpp.org/community/> for a complete list.

Errata can be sent to <editor@xmpp.org>.

Appendix F: Requirements Conformance

The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".

Appendix G: Notes

1. XEP-0367: Message Attaching <https://xmpp.org/extensions/xep-0367.html>.

2. XEP-0030: Service Discovery <https://xmpp.org/extensions/xep-0030.html>.

3. XEP-0115: Entity Capabilities <https://xmpp.org/extensions/xep-0115.html>.

4. XEP-0359: Unique and Stable Stanza IDs <https://xmpp.org/extensions/xep-0359.html>.

5. Unicode® Technical Standard #51 <http://www.unicode.org/reports/tr51/>.

6. XEP-0334: Message Processing Hints <https://xmpp.org/extensions/xep-0334.html>.

7. XEP-0308: Last Message Correction <https://xmpp.org/extensions/xep-0308.html>.

8. XEP-0203: Delayed Delivery <https://xmpp.org/extensions/xep-0203.html>.

9. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.

10. The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see <https://xmpp.org/registrar/>.

Appendix H: Revision History

Note: Older versions of this specification might be available at https://xmpp.org/extensions/attic/

  1. Version 0.0.1 (2019-07-14)

    First draft.


Appendix I: Bib(La)TeX Entry

  title = {Message Reactions},
  author = {Wirth, Natalie and Wissfeld, Marvin},
  type = {XEP},
  number = {xxxx},
  version = {0.0.1},
  institution = {XMPP Standards Foundation},
  url = {https://xmpp.org/extensions/xep-xxxx.html},
  date = {2019-07-14/2019-07-14},