<p>A chat participant might want to retract a message which they've already sent out, for example if they've mistakenly sent it to the wrong recipient or groupchat.</p>
<p>Due to the federated and extensible nature of XMPP it's not possible to remove a message with full certainty and a retraction can only be considered an <strong>unenforceable request</strong> for such removal. Clients which don't support message retraction are not obligated to enforce the request and people could have seen or copied the message contents already.</p>
<p>If a client or service implements message retraction, it MUST specify the 'urn:xmpp:message-retract:0' feature in its service discovery information features as specified in &xep0030; and the Entity Capabilities profile specified in &xep0115;.</p>
<p>The message author notices that the message was sent to the wrong recipient and indicates to their client that the message should be retracted.</p>
<p>The client sends out a retraction message which uses &xep0422; to indicate that it applies to the wrongly sent message by referring to its XEP-0359 origin ID.</p>
<examplecaption="The client sends out a retraction message"><![CDATA[
<p>An archiving service MAY replace 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). The message gets replaced with a <retracted/> element which SHOULD include a 'by' attribute specifying the JID of the entity that sent the retraction and a 'stamp' attribute indicating the time at which the retraction took place.</p>
<p>A receiving client can choose to remove the retracted message from whatever display is used for messages, from any stored history, or choose to display the fact that a message has been retracted in another way.</p>
<p>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 joiningthe room, omitting the message from history archive requests where possible, or replacing the original message with a 'tombstone').</p>
<p>Some clients may have been offline while the retraction was issued. The archiving service therefore MUST store the retraction message, regardless of whether the original message is deleted or replaced with a tombstone. These clients will then become aware of the retraction as soon as they catch up with the archive.</p>
<p>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.</p>
<p>A retraction (that's not part of a protoXEP message moderation operation) MUST only be processed when both the original message and the retraction request are received from the same bare-JID (in a one-on-one conversation) or full-JID (in a non-anonymous MUC from &xep0045;).</p>
<p>When used in a semi-anonymous MUC, the recipient client MUST check that a message retraction was sent by the author of the retracted message by checking the occupant id from &xep0421;.</p>
<p>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.</p>
<p>To prevent message spoofing, it's very important that the JID or occupant id of message retractions are checked (as explained in the <linkurl='#rules'>Business Rules</link> section).</p>