[Standards-JIG] Live Chat extension to Chat States (JEP-0085)

Cedric Vivier cedricv at neonux.com
Tue Jan 4 16:36:08 UTC 2005

Hash: SHA1

Live Chat extension aka WYSIWYCT (What You See Is What Your Contact Type
;)) or "Composing Body" for short.

I don't know if it's better to extend JEP-0085 or to propose another
brand new JEP superseding it.
I believe however it should just extends current JEP as this extension
is a "SHOULD" and shouldn't break compatibility with current JEP-0085
implementations (which are experimental anyway).

This extension allows some sort of 'really instantaneous IM' ;)


5.1 Discovery of Support and Generation of Notifications

. A User MUST NOT send composing body notifications if the contact had
not sent an Active notification with a <body/> element.

5.2 Support Requirements

| Active                   | MUST   |
| Composing (without body) | MUST   |
| Composing (with body)    | SHOULD |

A client MUST allow the user to configure whether he or she wants to
send chat state notifications and MUST allow the user to disable
outgoing Composing Body even if chat state notifications are enabled.

5.8 Composing Body

When sending a composing notification <composing/> element can include a
<body/> element.
A client can then send words (ie. tokens) as the users type them in the
edit box alongside to composing notifications.
Clients SHOULD send the last word (delimited by spaces) typed after a
short delay (500ms for instance) and not send <body/> element at each
and every letter.

<body> has two optional attributes and can have plain text as content :

| value           | description
- ------------------------------------------------
| clear (default) | Reset composing body to content.
| append          | Append content to composing body.
| replace         | Replace last @count token(s) by content

Default is 1.
It is used only when @mode is "replace" to define how many previously
appended tokens to replace.

6.1 A Simple Example With Composing Body Enabled

Example 5. User Sends Intitial Mesage With Active Notification

<message from="romeo at montague.net/orchard"
to="juliet at capulet.com/balcony" type="chat">
~ <body>Are you here Juliet ?</body>
~  <active xmlns="http://jabber.org/protocol/chatstates">
~   <body/>
~  </active>

Example 6. Contact's Sends Reply Plus Active Notification

<message from="juliet at capulet.com/balcony"
to="romeo at montague.net/orchard" type="chat">
~ <body>Yes I am.</body>
~  <active xmlns="http://jabber.org/protocol/chatstates">
~   <body/>
~  </active>

Example 7. User Sends Composing Notifications With Initial Body

<message from="romeo at montague.net/orchard"
to="juliet at capulet.com/balcony" type="chat">
~ <composing xmlns="http://jabber.org/protocol/chatstates">
~  <body>I</body>
~ </composing>

Example 8. User Continues Typing His Message

<message from="romeo at montague.net/orchard"
to=juliet at capulet.com/balcony" type="chat">
~ <composing xmlns="http://jabber.org/protocol/chatstates">
~  <body mode="append"> luv</body>
~ </composing>

Example 9. User Has Made A Mistake And So Corrects It

<message from="romeo at montague.net/orchard"
to="juliet at capulet.com/balcony" type="chat">
~ <composing xmlns="http://jabber.org/protocol/chatstates">
~  <body mode="replace"> love</body>
~ </composing>

Example 10. User Has Finished Composing His Message

<message from="romeo at montague.net/orchard"
to="juliet at capulet.com/balcony" type="chat">
~ <body>I love you!</body>
~ <active xmlns="http://jabber.org/protocol/chatstates">
~  <body/>
~ </active>

11. XML Schema

<xs:element name='active' type='empty'/>
<xs:element name='composing' type='empty'/>

Becomes this:
<xs:element name='active'>
~ <xs:element name='body' minOccurs='0' maxOccurs='1' type='empty'/>
<xs:element name='composing'>
~ <xs:element name='body' minOccurs='0' maxOccurs='1'>
~  <xs:complexType>  <!-- xmpp-im rfc 3921 schema -->
~   <xs:simpleContent>
~    <xs:extension base='xs:string'>
~     <xs:attribute name='mode' use='optional' default='clear'>
~      <xs:simpleType>
~       <xs:restriction base='xs:NCName'>
~        <xs:enumeration value='clear'/>
~        <xs:enumeration value='append'/>
~        <xs:enumeration value='replace'/>
~       </xs:restriction>
~      </xs:simpleType>
~     </xs:attribute>
~     <xs:attribute name='count' type='xs:positiveInteger' use='optional'
~     <xs:attribute ref='xml:lang' use='optional'/>
~    </xs:extension>
~   </xs:simpleContent>
~  </xs:complexType>
~ </xs:element>

- --cedricv
jid: cedricv at jabber.neonux.com
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org


More information about the Standards mailing list