XEP-0245: The /me Command

This specification defines recommended handling of the /me command in XMPP instant messaging clients.
Peter Saint-Andre
© 2008 – 2009 XMPP Standards Foundation. SEE LEGAL NOTICES.


NOTICE: This Informational specification defines a best practice or protocol profile that has been approved by the XMPP Council and/or the XSF Board of Directors. Implementations are encouraged and the best practice or protocol profile is appropriate for deployment in production systems.
1.0 (2009-01-21)
Document Lifecycle
  1. Experimental
  2. Proposed
  3. Active

1. Introduction

Many Jabber/XMPP instant messaging clients provide special processing and presentation of the string "/me " at the beginning of a message body. This specification describes the recommended handling of this "command".

2. Recommended Handling

The /me command [1] is a text string that enables a human user to type an action phrase and have it be presented in a special way within an instant messaging client. The text string is followed by a verb or verb phrase, such as "/me laughs" or "/me is logging off now". This command does not result in the generation of any XMPP protocol. Instead, the command is sent as-is (e.g., <body>/me laughs</body>) and the receiving client performs string-matching on the first four characters of the data included in the <body/> element to determine if the message begins with the string "/me ". If the client finds a match, the receiving client will show the message with a special presentation. It is RECOMMENDED for the client to show the receiving client's understanding of the sender's user name, nickname, or handle [2] followed by the verb phrase in italicized text, prepended by the "*" character.

For example, imagine that the Greek god Atlas is in a chatroom with the other gods and types the following text in his IM client:

Example 1. A /me Command
/me shrugs in disgust

That text will be sent to all the occupants in the chatroom as follows:

Example 2. XMPP Stanza
<message from='olympians@chat.gods.lit/Atlas'
  <body>/me shrugs in disgust</body>

Each recipient's client would then show the message with a special presentation, such as:

Example 3. Presentation of /me Command
* Atlas shrugs in disgust

If the receiving client does not find a match on the string "/me " in the first four characters of the message body, it SHOULD NOT present the text in a special way. For example, the following message bodies do not match:

Example 4. Some Non-Commands
<body>/meshrugs in disgust</body>

<body>/me's disgusted</body>

<body> /me shrugs in disgust</body>

<body>"/me shrugs in disgust"</body>

<body>* Atlas shrugs in disgust</body>

<body>Why did Atlas say "/me shrugs in disgust"?</body>

3. Integration With XHTML-IM

XHTML-IM (XEP-0071) [5] describes a method for lightweight formatting of a message body using a subset of XHTML. For example, the stanza shown above might be formatted in the color green, as follows.

Example 5. XMPP Stanza With XHTML-IM
<message from='olympians@chat.gods.lit/Atlas'
  <body>/me shrugs in disgust</body>
  <html xmlns='http://jabber.org/protocol/xhtml-im'>
    <body xmlns='http://www.w3.org/1999/xhtml'>
      <p style='color:green'>/me shrugs in disgust</p>

The XHTML-formatted version of the message MUST NOT modify the "/me " command string (e.g., in this case to something like "* Atlas shrugs in disgust") because the recipient might have a different user name, nickname, or handle on file for the sender.

4. Accessibility Considerations

This specification describes the /me command in terms of visual presentation. A receiving client that presents messages aurally MAY modify its presentation of /me commands and SHOULD at a minimum transform the string "/me " into the user name, nickname, or handle of the sender.

5. Security Considerations

Multi-User Chat (XEP-0045) [6] rooms send XMPP presence stanzas when people leave and join the room, and receiving clients typically show these presence changes as the equivalent of in-room messages, such as the following transformation of a presence stanza of type unavailable:

Example 6. Presentation of In-Room Presence Notification
*** Atlas has left the room

A sender could attempt to spoof such a leave message by sending an XMPP groupchat message stanza whose body text is "/me has left the room". Although the presentation of presence joins and leaves is determined by the receiving client and therefore such a notification cannot be universally spoofed for all receivers, a client SHOULD differentiate between presence notifications and /me commands (e.g., with different colors and different prepended characters, such as several asterisks for presence notifications and one asterisk for /me commands).

6. IANA Considerations

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

7. XMPP Registrar Considerations

This document requires no interaction with the XMPP Registrar [8].

8. Acknowledgements

Thanks to Dave Cridland, Kevin Smith, and Matthew Wild for their feedback and suggestions.


Appendix A: Document Information

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

This document in other formats: XML  PDF

Appendix B: Author Information

Peter Saint-Andre


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. The string "/me " is usually pronounced "slash-me".

2. On the difference between user names, nicknames, and handles, see Best Practices to Prevent JID Mimicking (XEP-0165) [3] and User Nickname (XEP-0172) [4].

3. XEP-0165: Best Practices to Prevent JID Mimicking <https://xmpp.org/extensions/xep-0165.html>.

4. XEP-0172: User Nickname <https://xmpp.org/extensions/xep-0172.html>.

5. XEP-0071: XHTML-IM <https://xmpp.org/extensions/xep-0071.html>.

6. XEP-0045: Multi-User Chat <https://xmpp.org/extensions/xep-0045.html>.

7. 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/>.

8. 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 1.0 (2009-01-21)

    Per a vote of the XMPP Council, advanced specification to Active and changed type from Historical to Informational.

  2. Version 0.2 (2009-01-08)

    Clarified handling of XHTML-IM formatting; added security consideration for multi-user chat rooms.

  3. Version 0.1 (2008-06-18)

    Initial published version.

  4. Version 0.0.1 (2008-06-09)

    First draft.


Appendix I: Bib(La)TeX Entry

  title = {The /me Command},
  author = {Saint-Andre, Peter},
  type = {XEP},
  number = {0245},
  version = {1.0},
  institution = {XMPP Standards Foundation},
  url = {https://xmpp.org/extensions/xep-0245.html},
  date = {2008-06-09/2009-01-21},