XEP-XXXX: Message Retraction

This specification defines a method for indicating that a message should be retracted.
Lance Stout
© 1999 – 2019 XMPP Standards Foundation. SEE LEGAL NOTICES.


WARNING: This Standards-Track document is Experimental. Publication as an XMPP Extension Protocol does not imply approval of this proposal by the XMPP Standards Foundation. Implementation of the protocol described herein is encouraged in exploratory implementations, but production systems are advised to carefully consider whether it is appropriate to deploy implementations of this protocol before it advances to a status of Draft.
Standards Track
0.0.3 (2016-10-19)
Document Lifecycle
  1. Experimental
  2. Proposed
  3. Draft
  4. Final

1. Introduction

Occasionally, a Multi-User Chat (XEP-0045) [1] room moderator or admin might wish to retract certain chat messages from the room history as part of an effort to address and remedy issues such as message spam, indecent language for the venue, exposing private third-party personal information, etc. However, as with any content moderation tool, the retraction request can only be considered as a hint and by itself can not prevent or undo any potential damage caused by the offending message, as clients which don't support message deletion are not obligated to enforce the deletion request and people could have seen or copied the message content already.

2. Discovering support

If a client or service implements message deletion, it MUST specify the 'urn:xmpp:message-retract: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 retraction
<iq type='get'
  <query xmlns='http://jabber.org/protocol/disco#info'>
    <feature var='urn:xmpp:message-retract:0'/>

3. Use Case

When a user indicates to the client that a sent message (or a received message for MUC room moderators) is meant to be retracted, the client will send a new message containing a <retract /> element with the "urn:xmpp:message-retract:0" namespace, with an id attribute set to the id of the message to be retracted.

Example 3. User sends a message with a mistake in
<message to='room@muc.example.com' id='bad1'>
  <body>This message contained information not meant for this room.</body>
Example 4. User indicates that the message should be retracted
<message to='room@muc.example.com' id='retract1'>
  <retract id='bad1' xmlns='urn:xmpp:message-retract:0'/>

4. Tombstones

An archiving service MAY replace the contents of a retracted message with a 'tombstone' recording the fact that the message was retracted (but otherwise preserving the fact that the message did once exist in order to aid synchronizing archives). To do so, the archiving service replaces the contents of the message with a <retracted/> element qualified by the 'urn:xmpp:message-retract:0' namespace, which SHOULD include a 'by' attribute specifying the JID of the entity that sent the retraction.

Example 5. Retracted message tombstone in a MAM result
<message id='aeb213' to='juliet@capulet.lit/chamber'>
  <result xmlns='urn:xmpp:mam:1' queryid='f27' id='28482-98726-73623'>
    <forwarded xmlns='urn:xmpp:forward:0'>
      <delay xmlns='urn:xmpp:delay' stamp='2010-07-10T23:08:25Z'/>
      <message xmlns='jabber:client' from="witch@shakespeare.lit" to="macbeth@shakespeare.lit">
        <retracted xmlns='urn:xmpp:message-retract:0' by='witch@shakespeare.lit' />

5. Business Rules

A receiving client can choose to remove the indicated message from whatever display is used for messages, from any stored history, or choose to display the fact that a message has been removed in another way.

A MUC or other service that supports message retraction SHOULD prevent further distribution of the message by the service (e.g., by not replaying the message to new occupants joining the room, omitting the message from history archive requests where possible, or replacing the original message with a 'tombstone').

A client MAY inform the user that a no-longer displayed message did previously exist and has been removed.

Clients and services MUST set the 'id' attribute on messages if they allow for message retraction.

The Sender MUST NOT send a retraction request for a message with non-messaging payloads. For example, a sender MUST NOT send a retraction for a roster item exchange request or a file transfer part.

A retraction MUST only be processed when both the original message and retraction request are received from the same full-JID (or from a JID of an appropriate admin or moderator in the case of a MUC room.)

6. Security Considerations

There can never be a guarantee that a retracted message was never seen or otherwise distributed, and it is encouraged for clients and services when possible to inform users that no such guarantee exists.

When used in a Multi-User Chat (XEP-0045) [1] context, retractions sent by non-moderators must not be allowed (by the receiver) for messages received before the sender joined the room - particularly a full JID leaving the room then rejoining and retracting a message SHOULD be disallowed, as the entity behind the full JID in the MUC may have changed.

7. IANA Considerations


8. XMPP Registrar Considerations

8.1 Protocol Namespaces

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

8.2 Protocol Versioning

If the protocol defined in this specification undergoes a revision that is not fully backwards-compatible with an older version, the XMPP Registrar shall increment the protocol version number found at the end of the XML namespaces defined herein, as described in Section 4 of XEP-0053.

9. XML Schema

<?xml version='1.0' encoding='UTF-8'?>


  <xs:element name='retract'>
        <xs:extension base='xs:string'>
          <xs:attribute name='id' type='xs:string' use='required'/>

  <xs:element name='retracted'>
        <xs:extension base='xs:string'>
          <xs:attribute name='by' type='xs:string' use='optional'/>



Appendix A: Document Information

XMPP Standards Foundation
Standards Track
Last Updated
Approving Body
XMPP Council
Superseded By
Short Name
Source Control

This document in other formats: XML  PDF

Appendix B: Author Information

Lance Stout


This XMPP Extension Protocol is copyright © 1999 – 2018 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 <http://xmpp.org/about/discuss.shtml> 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-0045: Multi-User Chat <https://xmpp.org/extensions/xep-0045.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. 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 http://xmpp.org/extensions/attic/

  1. Version 0.0.3 (2016-10-19)

    Fix the XEP title to be Message Retraction.

  2. Version 0.0.2 (2016-10-12)

    Use the term 'retraction' instead of 'deletion'. Added tombstone marker.

  3. Version 0.0.1 (2015-07-07)

    First draft.