Abstract: | This document defines an XMPP protocol extension used to request and respond to events relating to the delivery, display, and composition of messages. |
Authors: | Jeremie Miller, DJ Adams, Peter Saint-Andre |
Copyright: | © 1999 - 2009 XMPP Standards Foundation. SEE LEGAL NOTICES. |
Status: | Deprecated |
Type: | Historical |
Version: | 1.3 |
Last Updated: | 2004-01-06 |
WARNING: This document has been deprecated by the XMPP Standards Foundation. Implementation of the protocol described herein is not recommended. Developers desiring similar functionality should implement the protocol that supersedes this one (if any).
1. Introduction
2. The Events
2.1. Offline
2.2. Delivered
2.3. Displayed
2.4. Composing
3. Usage
3.1. Requesting Event Notifications
3.2. Raising Events
3.3. The Composing Event
4. Examples
5. Implementation Notes
6. Security Considerations
7. IANA Considerations
8. XMPP Registrar Considerations
9. XML Schema
10. Open Issues
Appendices
A: Document Information
B: Author Information
C: Legal Notices
D: Relation to XMPP
E: Discussion Venue
F: Requirements Conformance
G: Notes
H: Revision History
The 'jabber:x:event' namespace defines extensions used to request and respond to events relating to the delivery, display, and composition of messages.
By attaching a jabber:x:event extension to a <message/> element, the sender can track stages in the delivery of that message to its recipient.
Note: More modern protocol extensions for this functionality have been defined in Chat State Notifications [1] for the composing and offline events and in Message Receipts [2] for the delivered and displayed events; those specifications supersede this one.
There are four message events currently defined in this namespace:
Indicates that the message has been stored offline by the intended recipient's server. This event is triggered only if the intended recipient's server supports offline storage, has that support enabled, and the recipient is offline when the server receives the message for delivery.
Indicates that the message has been delivered to the recipient. This signifies that the message has reached the recipient's Jabber client, but does not necessarily mean that the message has been displayed. This event is to be raised by the Jabber client.
Once the message has been received by the recipient's Jabber client, it may be displayed to the user. This event indicates that the message has been displayed, and is to be raised by the Jabber client. Even if a message is displayed multiple times, this event should be raised only once.
In threaded chat conversations, this indicates that the recipient is composing a reply to a message. The event is to be raised by the recipient's Jabber client. A Jabber client is allowed to raise this event multiple times in response to the same request, providing the original event is cancelled first.
Extensions qualified by the jabber:x:event namespace may be used only in the context of <message/> elements. That is, event information should be requested, and given in response, in relation to <message/> elements only, and not <presence/> or <iq/> elements.
Event information should only be sent in response to a request for that information. Unsolicited event information is illegal. In addition, a client should not request message event information from a correspondent if it is known (for example through the results of a previous browse request) that the correspondent does not support message events.
Any request for the offline event in a message that has been stored offline must be removed by the server before the message is forwarded to the Jabber client. This means that any <offline/> tag should be removed from the extension.
Event notifications are requested by attaching an extension qualified by the jabber:x:event namespace to a <message/> element. A tag representing each event type requested for that message should be placed within the extension. Only one jabber:x:event extension may be attached to a <message/> element, but multiple event types may be requested within that one extension. The tags representing each of the event types are <offline/>, <delivered/>, <displayed/>, and <composing/>.
An example of a <message/> element with a jabber:x:event extension is shown here.
<message to='romeo@montague.net' id='message22'> <body>Art thou not Romeo, and a Montague?</body> <x xmlns='jabber:x:event'> <offline/> <delivered/> <composing/> </x> </message>
Here we see the sender wants to be notified if the message is stored offline (by the server), notified when the message is delivered (to the client), and notified if the recipient begins replying to the message. In this case, the sender will potentially receive three events based on this request. The first if the recipient is offline and the message is stored on the server, the second when the recipient becomes available and the message is delivered, and the third if the recipient begins composing a reply to the message.
Note that the <message/> element requesting event notification contains an 'id' attribute. While these attributes are optional in the Jabber protocol, messages that contain event notification requests MUST contain an 'id' attribute so that raised events may be matched up with their original requests.
If the message is stored by the server, the server must raise the requested event (offline) by sending a message to the sender as shown in this example:
<message from='romeo@montague.net' to='juliet@capulet.com/balcony'> <x xmlns='jabber:x:event'> <offline/> <id>message22</id> </x> </message>
When raising an event, the raiser must send a <message/> element constructed according to the following rules:
The composing event is slightly different from the other events in that it can be raised and cancelled multiple times. This is to allow the reflection of what actually is happening when a user replies to a message; he may start composing a reply, which would trigger the composing event, get halfway through, and stop (by some definition of "stop", which may be implementation-specific). At this stage the event is no longer valid, or at least doesn't make much sense. So the client may send a cancellation for the composing event just raised.
The cancellation is raised by sending another jabber:x:event; however, in contrast to how the events are usually raised, no <composing/> tag is sent, just an <id/> tag, like this:
<message from='romeo@montague.net' to='juliet@capulet.com/balcony'> <x xmlns='jabber:x:event'> <composing/> <id>message22</id> </x> </message>
<message from='romeo@montague.net' to='juliet@capulet.com/balcony'> <x xmlns='jabber:x:event'> <id>message22</id> </x> </message>
The lack of an <composing/> tag (and any other event tag) signifies that the composing event, indicated previously by the id value, has been cancelled. In this example, the composing event being cancelled is that event that was previously raised with the id of message22. After cancelling a composing event, a new one may be raised, following the same rules as before, when the typing of the reply is resumed.
This section contains a number of examples to illustrate the full flow of messages, event notifications, and event cancellations for a fictional conversation.
SEND: <message to='romeo@montague.net' id='message22'> <body>Art thou not Romeo, and a Montague?</body> <x xmlns='jabber:x:event'> <offline/> <delivered/> <displayed/> <composing/> </x> </message>
Romeo temporarily loses his wireless connection in the Capulet's orchard and therefore his message is stored offline by the montague.net server, which generates the offline event and sends that notification to Juliet.
RECV: <message from='romeo@montague.net' to='juliet@capulet.com/balcony'> <x xmlns='jabber:x:event'> <offline/> <id>message22</id> </x> </message>
Romeo reconnects and the message is delivered to his Jabber client, which generates a delivered event and sends it to Juliet's client.
RECV: <message from='romeo@montague.net/orchard' to='juliet@capulet.com/balcony'> <x xmlns='jabber:x:event'> <delivered/> <id>message22</id> </x> </message>
Romeo's Jabber client displays the message and sends a displayed event to Juliet's client.
RECV: <message from='romeo@montague.net/orchard' to='juliet@capulet.com/balcony'> <x xmlns='jabber:x:event'> <displayed/> <id>message22</id> </x> </message>
Romeo begins composing a reply to Juliet's heartfelt question, and his Jabber client notifies Juliet that he is composing a reply.
RECV: <message from='romeo@montague.net/orchard' to='juliet@capulet.com/balcony'> <x xmlns='jabber:x:event'> <composing/> <id>message22</id> </x> </message>
Romeo realizes his reply is too rash and pauses to choose the right words; his Jabber client senses the delay and cancels the previous composing event.
RECV: <message from='romeo@montague.net/orchard' to='juliet@capulet.com/balcony'> <x xmlns='jabber:x:event'> <id>message22</id> </x> </message>
Romeo starts composing again, and his Jabber client sends a notification to Juliet's client.
RECV: <message from='romeo@montague.net/orchard' to='juliet@capulet.com/balcony'> <x xmlns='jabber:x:event'> <composing/> <id>message22</id> </x> </message>
Romeo finally sends his reply, and requests composing events related to it.
SEND: <message to='juliet@capulet.com' id='GabberMessage43'> <body>Neither, fair saint, if either thee dislike.</body> <x xmlns='jabber:x:event'> <composing/> </x> </message>
Compliant implementations SHOULD observe the following business rules:
There are no security features or concerns related to this proposal.
This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [3].
No action on the part of the XMPP Registrar [4] is necessary as a result of this document, since 'jabber:x:event' is already a registered protocol namespace.
<?xml version='1.0' encoding='UTF-8'?> <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' targetNamespace='jabber:x:event' xmlns='jabber:x:event' elementFormDefault='qualified'> <xs:annotation> <xs:documentation> The protocol documented by this schema is defined in XEP-0022: http://www.xmpp.org/extensions/xep-0022.html </xs:documentation> </xs:annotation> <xs:element name='x'> <xs:complexType> <xs:sequence> <xs:element name='offline' minOccurs='0' type='empty'/> <xs:element name='delivered' minOccurs='0' type='empty'/> <xs:element name='displayed' minOccurs='0' type='empty'/> <xs:element name='composing' minOccurs='0' type='empty'/> <xs:element name='id' minOccurs='0' type='xs:NMTOKEN'/> </xs:sequence> </xs:complexType> </xs:element> <xs:simpleType name='empty'> <xs:restriction base='xs:string'> <xs:enumeration value=''/> </xs:restriction> </xs:simpleType> </xs:schema>
Series: XEP
Number: 0022
Publisher: XMPP Standards Foundation
Status:
Deprecated
Type:
Historical
Version: 1.3
Last Updated: 2004-01-06
Approving Body: XMPP Council
Dependencies: XMPP Core
Supersedes: None
Superseded By: XEP-0085, XEP-0184
Short Name: x-event
Schema: <http://www.xmpp.org/schemas/x-event.xsd>
Source Control:
HTML
RSS
Email:
jer@jabber.org
JabberID:
jer@jabber.org
Email:
dj.adams@pobox.com
JabberID:
dj@gnu.mine.nu
JabberID:
stpeter@jabber.org
URI:
https://stpeter.im/
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 3920) and XMPP IM (RFC 3921) 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.
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 may be sent to <editor@xmpp.org>.
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".
1. XEP-0085: Chat State Notifications <http://xmpp.org/extensions/xep-0085.html>.
2. XEP-0184: Message Receipts <http://xmpp.org/extensions/xep-0184.html>.
3. 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/>.
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 <http://xmpp.org/registrar/>.
END