RFC 3994

Indication of Message Composition for Instant Messaging

πŸ“… published February 2005, from ietf

RFC 3994 πŸ’– Indication of Message Composition for Instant Messaging

Okay bestie, here's the title block first πŸŽ€

  • Network Working Group 🌸
  • RFC number: 3994
  • Title: Indication of Message Composition for Instant Messaging
  • Author: H. Schulzrinne, Columbia U. πŸ¦‹
  • Category: Standards Track ✨
  • Date: January 2005 πŸ“…

The header doesn't have an Obsoletes or Updates line, so there's nothing listed there that it replaces or amends πŸ‘‘


Status of This Memo πŸ’…

This is an Internet standards track protocol for the whole Internet community, and the authors are literally asking for discussion and suggestions πŸ—£οΈ For the standardization state and status of this protocol, check the current edition of "Internet Official Protocol Standards" (STD 1). That's the official source πŸ“š Distribution of this memo is unlimited, so share it around 🌈

Copyright (C) The Internet Society (2005).

Abstract ✨

So in instant messaging (IM) systems, it's really useful to know during a conversation whether the other person is composing a message, like typing or recording a voice note πŸŽ™οΈ This document defines a new status message content type and XML namespace that carries info about a message being composed. The status message can cover any type of message, including text, voice, or video πŸ’œ These status messages get delivered to the IM recipient the same way the actual instant messages do πŸ’Œ

Table of Contents 🧚

   1.  Introduction . . . . . . . . . . . . . . . . . . . . . . . . .  2
   2.  Terminology and Conventions  . . . . . . . . . . . . . . . . .  3
   3.  Description  . . . . . . . . . . . . . . . . . . . . . . . . .  3
       3.1.  Overview . . . . . . . . . . . . . . . . . . . . . . . .  3
       3.2.  Message Composer Behavior  . . . . . . . . . . . . . . .  4
       3.3.  Status Message Receiver Behavior . . . . . . . . . . . .  5
       3.4.  Message Content  . . . . . . . . . . . . . . . . . . . .  6
       3.5.  Additional Status Information  . . . . . . . . . . . . .  6
   4.  Using the Status Message . . . . . . . . . . . . . . . . . . .  7
   5.  Examples . . . . . . . . . . . . . . . . . . . . . . . . . . .  8
   6.  XML Document Format  . . . . . . . . . . . . . . . . . . . . .  8
       6.1.  XML Schema . . . . . . . . . . . . . . . . . . . . . . .  9
   7.  Security Considerations  . . . . . . . . . . . . . . . . . . .  9
   8.  IANA Considerations  . . . . . . . . . . . . . . . . . . . . . 10
       8.1.  Content-Type Registration for
             'application/im-iscomposing+xml' . . . . . . . . . . . . 10
       8.2.  URN Sub-Namespace Registration for
             'urn:ietf:params:xml:ns:im-iscomposing'  . . . . . . . . 11
       8.3.  Schema Registration  . . . . . . . . . . . . . . . . . . 11
   9.  Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 11
   10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 12
       10.1. Normative References . . . . . . . . . . . . . . . . . . 12
       10.2. Informative References . . . . . . . . . . . . . . . . . 12
   Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 12
   Full Copyright Statement . . . . . . . . . . . . . . . . . . . . . 13

1. Introduction 🌈

Instant messaging (IM) is message based by definition πŸ’¬ A user composes a message by typing, speaking, or recording a video clip, then it gets sent to one or more recipients. Unlike email, IM is usually conversational, so the other person is sitting there waiting for a reply πŸ₯Ί If no reply shows up, a participant can wrongly assume that the partner has left, or that it's their turn to type again 😭 and then two messages end up "crossing on the wire" πŸ™ˆ

To fix that uncertainty, a bunch of commercial IM systems have an "is-typing" indicator that gets sent as soon as one person starts typing ⌨️ This document describes a generalized version of that indicator, called the isComposing status message. As Section 3 explains in more detail, a status message is delivered to the IM recipient the same way the messages themselves are πŸ’Œ isComposing status messages can announce the composition of any media type, not just text. For example, somebody recording an audio or video clip πŸŽ₯ In the future it can also be extended to convey other IM user states ✨ For brevity, these messages get called "status messages" from here on πŸ¦‹

The status messages are carried as XML, as instances of the XML schema defined in Section 6, and labeled with the content type application/im-iscomposing+xml 🧁

Honestly these status messages are kind of like the comfort noise packets sent during silence-suppressed interactive voice conversations 🎧

Events and extensions to presence, such as PIDF [6], were also considered but have a number of disadvantages. They add more overhead, because an explicit and periodic subscription is required. For page-mode delivery, subscribing to the right user agent and set of messages may not be easy. An in-band, message-based mechanism is also easier to translate across heterogeneous instant messaging systems. πŸ™ƒ

The mechanism described here aims to satisfy the requirements in [7] 🎯

2. Terminology and Conventions πŸ“–

This memo uses the vocabulary defined in the IMPP Model document [1]. Terms like CLOSED, INSTANT MESSAGE, OPEN, PRESENCE SERVICE, PRESENTITY, WATCHER, and WATCHER USER AGENT mean the same thing they mean there πŸ’œ The key words MUST, MUST NOT, REQUIRED, SHOULD, SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL in this document are to be interpreted as described in BCP 14, RFC 2119 [2] πŸ”‘

This document talks about two kinds of messages. First there's the instant message (IM), which carries the actual content between two or more users in an IM conversation. Second there's the status message, described in this document, which tells the other participants in a conversation what the current composing status is 🫢 We use the terms "content message" and "status message" for these two types.

3. Description πŸŽ€

3.1. Overview

We model the user of an IM system as being in one of several states. In this document that's limited to "idle" and "active" 🌸 By default the user is in the "idle" state, both before they start composing a message and after they send it 😌

3.2. Message Composer Behavior

Only the IM user agent that's actively composing a content message generates status messages showing the current state ✍️ When the user starts composing a content message (the actual instant message), the state becomes "active", and an isComposing status message containing a <state> element indicating "active" is sent to the recipient of the content message being composed. As long as the user keeps producing message content, they stay in the "active" state πŸƒβ€β™€οΈ

There are two sender timers: the active-state refresh interval, and the idle time-out interval ⏱️

The active-state refresh interval determines how often "active" state messages get sent while the composer is still in "active" state. The composing user chooses this interval and it's indicated in the <refresh> element of the status message, as an integer number of seconds. Each transmission of the isComposing message resets the timer. The interval SHOULD be no shorter than 60 seconds. A message composer MAY decide not to send active-state refresh messages at all πŸ™Œ To signal that, you leave out the refresh interval, and that makes the receiver assume the sender has gone idle after 120 seconds. (In most cases, the content message will have been sent by then πŸ“¨) No refresh messages get sent in the "idle" state.

The active-state refresh mechanism covers the case where the user logs off or the application crashes before the content message is finished. πŸ’€

If the user stops composing for longer than a configured time interval, the idle timeout, the state moves to "idle" and an "idle" status message gets sent 😴 If the user starts composing again while in the "idle" state, the state moves to "active" and the matching status message gets sent. Unless the user configures something else, the idle timeout SHOULD have a default value of 15 seconds ⏳

If a content message gets sent before the idle threshold expires, no "idle" indication is needed. So in most cases you only get one status message per content message πŸ₯° Either way, the message rate is limited to one status message per refresh threshold interval 🚦

The state transitions are shown in Figure 1 πŸ¦‹

                      +-------------+
                      |+-----------+|
                      ||           ||
               +------>|   idle    |<--------+
               |      ||           ||        |
               |      |+-----------+|        |
               |      +------+------+        |
   content     |             |               | idle timeout
   msg. sent   |             | composing     | w/o activity
   ----------- |             | ------------- | ------------------
    --         |             | "active" msg. | "idle" status msg.
               |             |               |
               |      +------V------+        |
               |      |             |        |
               |      |             |        |
               |      |             |        |
               +------+   active    +--------+
                      |             |
                      |             |------+
                      +------^------+      | refresh timeout
                             |             | --------------------
                             |             | "active" status msg.
                             +-------------+

Figure 1. Sender State Diagram πŸ“Š

3.3. Status Message Receiver Behavior

The receiver uses status messages to figure out the state of the content message sender πŸ‘€ If the most recent "active" status message had a <refresh> value, the refresh time-out gets set to that value. Otherwise it's 120 seconds. At the receiver, the state moves from "active" back to "idle" under three conditions:

  1. A status message with status "idle" is received.
  2. A content message is received.
  3. The refresh interval expires.

Receivers MUST be able to handle multiple consecutive isComposing messages with "active" state, regardless of the refresh interval πŸ’ͺ

The state transitions are shown in Figure 2 πŸ¦‹

                           +-------------+
                           |+-----------+|
                           ||           ||
                    +------>|   idle    |<------+
                    |      ||           ||      |
                    |      |+-----------+|      |
                    |      +------+------+      |
                    |             |             |
       "idle" recd. |             |"active" msg.| refresh timeout
   or content recd. |             |             | or 120s
                    |             |             |
                    |      +------V------+      |
                    |      |             |      |
                    |      |             |      |
                    |      |             |      |
                    +------+   active    +------+
                           |             |
                           |             |
                           +-------------+

Figure 2. Receiver State Diagram πŸ“Š

3.4. Message Content ✨

okay so quick recap before we go further πŸ’… this bit is non-normative, meaning it's just vibes and not actual rules. For the official format, go check Section 6 πŸŽ€

The message is an <isComposing> element with a mandatory <state> element that says whether the composer is idle or active 🌸 Then there are three optional extras: <lastactive> (when they last did something), <contenttype> (what kind of message they're making), and <refresh> (how long the receiver can wait before getting an update from the composer) πŸ¦‹ We'll get into the details next πŸ’–

3.5. Additional Status Information 🧚

The status message can carry extra optional bits that give more detail on the composing activity πŸ’… Any of these can show up in both "active" and "idle" messages.

The optional <lastactive> element is the absolute time when the user last added or edited content ⏰

The optional <contenttype> element tells you what type of medium the messaging terminal is composing in right now 🎧 It can be just a MIME media type, like "audio" or "text", or a media type and subtype, like "text/html". Think of it as a hint for the user, not a promise, that the actual message will really only contain what it says πŸ™ˆ It just helps the human recipient get ready for the likely format πŸ’œ

To further describe message composition, the XML schema or the set of allowable state names can be extended in future documents 🌈 Recipients of status messages implementing this specification without extensions MUST treat state tokens other than "idle" and "active" as "idle". Additional elements MUST use their own namespaces and MUST be designed so that receivers can safely ignore such extensions. Adding elements to the namespace defined in this document is not permitted. Bestie, don't touch that namespace 🚫

The isComposing status message MAY be carried in CPIM messages [3].

Such a wrapper is super useful if messages get relayed by a conference server, since the CPIM message keeps the identity of the original composer 🫢

4. Using the Status Message ✨

The isComposing status message can be used with either page mode or session mode, although session mode is a more natural fit πŸ¦‹ In session mode, the status message is sent as part of the messaging stream. Its usage is negotiated just like any other media type in that stream, with details depending on the session mode protocol πŸ”₯

Sending the status messages inside the session-mode messaging stream has at least three benefits πŸ‘‘ First, it guarantees proper ordering and synchronization with the actual content messages being composed. In messaging systems that guarantee in-order delivery, this stops an active indication from showing up at the receiver after the real message has already arrived, which would happen if the two got reordered across two delivery mechanisms 😭

Secondly, end-to-end security can be applied to the messages πŸ” Thirdly, session negotiation mechanisms can be used to turn it on and off at any time, and even to negotiate its use in a single direction at a time 🌸

Usage with page mode is also pretty straightforward: the status message is carried as the body of a page mode message πŸ’Œ In SIP-based IM, the composer MUST cease transmitting status messages if the receiver returned a 415 status code (Unsupported Media Type) in response to a MESSAGE request containing the status indication. Respect the 415, bestie πŸ™…β€β™€οΈ

The sender can't be assured that the status message gets delivered before the actual content being composed arrives 😬 BUT (not caps-locked, just vibes) SIP page mode is limited to one unacknowledged message, so out-of-order delivery is unlikely, although still possible if proxies are involved 🧚


5. Examples πŸŽ€

Here are two examples of a status message. First, an active composer working on some plain text:

<?xml version="1.0" encoding="UTF-8"?>
<isComposing xmlns="urn:ietf:params:xml:ns:im-iscomposing"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:ietf:params:xml:ns:im-composing
iscomposing.xsd">
  <state>active</state>
  <contenttype>text/plain</contenttype>
  <refresh>90</refresh>
</isComposing>

Next, an idle composer whose last activity was a while back, and who was working on audio:

<?xml version="1.0" encoding="UTF-8"?>
<isComposing xmlns="urn:ietf:params:xml:ns:im-iscomposing"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:ietf:params:xml:ns:im-composing
iscomposing.xsd">
  <state>idle</state>
  <lastactive>2003-01-27T10:43:00Z</lastactive>
  <contenttype>audio</contenttype>
</isComposing>

6. XML Document Format πŸ’–

An isComposing document is an XML document that MUST be well formed and SHOULD be valid 🧐 isComposing documents MUST be based on XML 1.0 and MUST be encoded by using UTF-8. This spec uses XML namespaces to identify isComposing documents. The namespace URI for elements defined for this purpose is a URN using the namespace identifier 'ietf'. Here's the URN, no cap, copy it exactly 🌈

urn:ietf:params:xml:ns:im-iscomposing

6.1. XML Schema πŸ¦‹

Here's the schema, and yes, it's giving rigid but it's also the source of truth πŸ‘‘

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="urn:ietf:params:xml:ns:im-iscomposing"
  elementFormDefault="qualified"
  attributeFormDefault="unqualified"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:tns="urn:ietf:params:xml:ns:im-iscomposing">
  <xs:element name="isComposing">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="state" type="xs:string"/>
        <xs:element name="lastactive" type="xs:dateTime"
          minOccurs="0"/>
        <xs:element name="contenttype" type="xs:string"
          minOccurs="0"/>
        <xs:element name="refresh" type="xs:positiveInteger"
          minOccurs="0"/>
        <xs:any namespace="##other" processContents="lax"
          minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

7. Security Considerations 🚨

Okay, this section is serious, so I'm putting on my serious face 😀 The isComposing indication gives a fine-grained view of the activity of the entity composing, so it deserves particularly careful confidentiality protection. Only the intended recipient of the message should receive the isComposing indication πŸ”’

Since the status messages are carried by using the IM protocol itself, all security considerations of the underlying IM protocol also apply to the isComposing status messages 🫣

There are potential privacy issues in sending isComposing status messages before an actual conversation has been established between the communicating users πŸ‘€ A status message may be sent even if the user later abandons the message, so it's not a guarantee of anything. It is RECOMMENDED that isComposing indications in page mode are only sent when a message is being composed as a reply to an earlier message. This document does not prescribe how an implementation detects whether a message is in response to an earlier one in page mode, but elapsed time or user interface behavior might be used as hints 🧠


8. IANA Considerations πŸ“‹

8.1. Content-Type Registration for 'application/im-iscomposing+xml' πŸ’…

Here's the registration template, copied exactly because IANA is very picky (and honestly, same) πŸŽ€

To: ietf-types@iana.org
Subject: Registration of MIME media type application/
   im-iscomposing+xml
MIME media type name: application
MIME subtype name: im-iscomposing+xml
Required parameters: (none)
Optional parameters: charset; Indicates the character encoding of
   enclosed XML.  Default is UTF-8.
Encoding considerations: Uses XML, which can employ 8-bit characters,
   depending on the character encoding used.  See RFC 3023 [4],
   section 3.2.
Security considerations: This content type is designed to carry
   information about current user activity, which may be considered
   private information.  Appropriate precautions should be adopted to
   limit disclosure of this information.
Interoperability considerations: This content type provides a common
   format for exchange of composition activity information.
Published specification: RFC 3994
Applications which use this media type: Instant messaging systems.
Additional information: none
Person & email address to contact for further information: Henning
   Schulzrinne, hgs@cs.columbia.edu
Intended usage: LIMITED USE
Author/Change controller: This specification is a work item of the
   IETF SIMPLE working group, with the mailing list address
   simple@ietf.org.
Other information: This media type is a specialization of
   application/xml RFC 3023 [4], and many of the considerations
   described there also apply to application/im-iscomposing+xml.

8.2. URN Sub-Namespace Registration for 'urn:ietf:params:xml:ns:im-iscomposing' 🌸

Next up is the namespace registration, with its little XHTML page included 🧚

URI: urn:ietf:params:xml:ns:im-iscomposing
Description: This is the XML namespace for XML elements defined by
   RFC 3994 to describe composition activity by an instant messaging
   client using the application/im-iscomposing+xml content type.
Registrant Contact: IETF, SIMPLE working group, simple@ietf.org,
   Henning Schulzrinne, hgs@cs.columbia.edu
XML:

 BEGIN
   <?xml version="1.0"?>
   <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN"
   "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">
   <html xmlns="http://www.w3.org/1999/xhtml">
   <head>
        <meta http-equiv="content-type"
        content="text/html;charset=iso-8859-1"/>
        <title>Is-composing Indication for Instant Messaging</title>
   </head>
   <body>
       <h1>Namespace for SIMPLE iscomposing extension</h1>
       <h2>urn:ietf:params:xml:ns:im-composing</h2>
       <p>See <a href="[URL of published RFC]">RFC3994</a>.</p>
    </body>
    </html>
 END

8.3. Schema Registration πŸŽ€

This section registers a new XML schema per the procedures in [5]. Here are the details πŸ’œ

URI: urn:ietf:params:xml:schema:im-composing
Registrant Contact: IETF, SIMPLE working group, (simple@ietf.org),
   Henning Schulzrinne (hgs@cs.columbia.edu).

The XML for this schema can be found as the sole content of Section 6.1 πŸ“„


9. Acknowledgements 🫢

Huge thanks to Ben Campbell, Miguel Garcia, Scott Hollenbeck, Christian Jansson, Cullen Jennings, Hisham Khartabil, Allison Mankin, Aki Niemi, Jonathan Rosenberg, and Xiaotao Wu for providing helpful comments πŸ’–


10. References πŸ“š

10.1. Normative References 🌟

[1] Day, M., Rosenberg, J., and H. Sugano, "A Model for Presence and Instant Messaging", RFC 2778, February 2000.

[2] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.

[3] Klyne, G. and D. Atkins, "Common Presence and Instant Messaging (CPIM): Message Format", RFC 3862, August 2004.

[4] Murata, M., St. Laurent, S., and D. Kohn, "XML Media Types", RFC 3023, January 2001.

[5] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, January 2004.

10.2. Informative References πŸ¦‹

[6] Sugano, H., Fujimoto, S., Klyne, G., Bateman, A., Carr, W., and J. Peterson, "Presence Information Data Format (PIDF)", RFC 3863, August 2004.

[7] Rosenberg, J., "Advanced Instant Messaging Requirements for the Session Initiation Protocol (SIP)", Work in Progress, February 2004.

Author's Address πŸ’Œ

Henning Schulzrinne
Columbia University
Department of Computer Science
450 Computer Science Building
New York, NY  10027
US

Phone: +1 212 939 7004
EMail: hgs@cs.columbia.edu
URI:   http://www.cs.columbia.edu/~hgs

Okay bestie, the legal bits, but make it cute πŸŽ€. The Internet Society owns the copyright for this one, dated 2005 πŸ“…. This document is covered by the rights, licenses, and restrictions in BCP 78, and apart from what BCP 78 says, the authors keep all of their rights πŸ¦‹.

This document and everything in it is given to you "AS IS" 🫢, and I need you to read this part carefully. THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, including, but not limited to, any promise that using the information here won't infringe anybody's rights, and any implied warranty of merchantability or fitness for a particular purpose 😭. Nobody is promising it'll be perfect, periodt πŸ’….


Intellectual Property 🌈

The IETF is not picking sides on whether any Intellectual Property Rights (or other rights) that someone might claim over the technology in this document are valid, how far they reach, or whether a license for them is even available πŸ™ˆ. It also hasn't gone out and hunted down any of those rights itself. If you want the IETF's rules on rights in IETF Documents, look in BCP 78 and BCP 79 πŸ“š.

Any IPR disclosures sent to the IETF Secretariat are kept, along with any assurances of licenses that get made available, and the results of anyone trying to get a general license or permission to use proprietary rights for this spec. Implementers and users can find all of that in the IETF's online IPR repository at http://www.ietf.org/ipr 🧚.

The IETF also invites anyone who's interested to flag any copyrights, patents, patent applications, or other proprietary rights that might cover technology needed to implement this standard πŸ”₯. Send that info to the IETF at ietf-ipr@ietf.org πŸ’Œ.


Acknowledgement πŸ“

Shoutout to the funding situation πŸ‘‘: the Internet Society is currently paying for the RFC Editor function πŸ’œ.

πŸ“¦ where this page comes from