No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xep-0085.xml 30KB

  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE xep SYSTEM 'xep.dtd' [
  3. <!ENTITY % ents SYSTEM 'xep.ent'>
  4. %ents;
  5. ]>
  6. <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
  7. <xep>
  8. <header>
  9. <title>Chat State Notifications</title>
  10. <abstract>This document defines an XMPP protocol extension for communicating the status of a user in a chat session, thus indicating whether a chat partner is actively engaged in the chat, composing a message, temporarily paused, inactive, or gone. The protocol can be used in the context of a one-to-one chat session or a multi-user chat room.</abstract>
  12. <number>0085</number>
  13. <status>Final</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <dependencies>
  17. <spec>XMPP Core</spec>
  18. <spec>XMPP IM</spec>
  19. <spec>XEP-0030</spec>
  20. </dependencies>
  21. <supersedes>
  22. <spec>XEP-0022</spec>
  23. </supersedes>
  24. <supersededby/>
  25. <shortname>chatstates</shortname>
  26. <schemaloc>
  27. <url></url>
  28. </schemaloc>
  29. &stpeter;
  30. &dizzyd;
  31. <revision>
  32. <version>2.1</version>
  33. <date>2009-09-23</date>
  34. <initials>psa</initials>
  35. <remark><p>Clarified that any state change is allowed.</p></remark>
  36. </revision>
  37. <revision>
  38. <version>2.0</version>
  39. <date>2008-11-26</date>
  40. <initials>psa</initials>
  41. <remark><p>Per a vote of the XMPP Council, advanced specification to Final; clarified the implicit discovery mechanism.</p></remark>
  42. </revision>
  43. <revision>
  44. <version>1.2</version>
  45. <date>2006-07-12</date>
  46. <initials>psa</initials>
  47. <remark><p>Added service discovery use case.</p></remark>
  48. </revision>
  49. <revision>
  50. <version>1.1</version>
  51. <date>2005-10-05</date>
  52. <initials>psa</initials>
  53. <remark><p>Clarified suggested triggers to discourage prospective notifications.</p></remark>
  54. </revision>
  55. <revision>
  56. <version>1.0</version>
  57. <date>2005-08-26</date>
  58. <initials>psa</initials>
  59. <remark><p>Per a vote of the Jabber Council, advanced status to Draft.</p></remark>
  60. </revision>
  61. <revision>
  62. <version>0.14</version>
  63. <date>2005-07-20</date>
  64. <initials>psa</initials>
  65. <remark><p>Clarified terminology; specified suggested state changes; removed section on superseding XEP-0022.</p></remark>
  66. </revision>
  67. <revision>
  68. <version>0.13</version>
  69. <date>2005-07-19</date>
  70. <initials>psa</initials>
  71. <remark><p>Further clarified business rules regarding generation of notifications.</p></remark>
  72. </revision>
  73. <revision>
  74. <version>0.12</version>
  75. <date>2005-07-15</date>
  76. <initials>psa</initials>
  77. <remark><p>Clarified business rules regarding generation of notifications; added reference to XEP-0155; rewrote introduction; moved previous introductory text to section on superseding XEP-0022.</p></remark>
  78. </revision>
  79. <revision>
  80. <version>0.11</version>
  81. <date>2005-07-05</date>
  82. <initials>psa</initials>
  83. <remark><p>Removed &lt;initial/&gt; state.</p></remark>
  84. </revision>
  85. <revision>
  86. <version>0.10</version>
  87. <date>2005-06-28</date>
  88. <initials>psa</initials>
  89. <remark><p>Added optional &lt;initial/&gt; state; added business rule on repetition of notifications; added implementation note.</p></remark>
  90. </revision>
  91. <revision>
  92. <version>0.9</version>
  93. <date>2004-10-28</date>
  94. <initials>psa</initials>
  95. <remark><p>Made &lt;inactive/&gt; state definition consistent with &lt;paused/&gt; per list discussion; made slight adjustments to wording throughout.</p></remark>
  96. </revision>
  97. <revision>
  98. <version>0.8</version>
  99. <date>2004-10-28</date>
  100. <initials>psa</initials>
  101. <remark><p>Further clarified state definitions and adjusted suggested event timing.</p></remark>
  102. </revision>
  103. <revision>
  104. <version>0.7</version>
  105. <date>2004-10-27</date>
  106. <initials>psa</initials>
  107. <remark><p>Clarified the meaning of the &lt;gone/&gt; state; adjusted suggested timing for events.</p></remark>
  108. </revision>
  109. <revision>
  110. <version>0.6</version>
  111. <date>2004-02-19</date>
  112. <initials>psa</initials>
  113. <remark><p>Added &lt;paused/&gt; state; defined the chat states; clarified the state chart; simplified the business rules.</p></remark>
  114. </revision>
  115. <revision>
  116. <version>0.5</version>
  117. <date>2003-09-18</date>
  118. <initials>psa</initials>
  119. <remark><p>Clarified that 'type' must be "chat" or "groupchat" for chat state notification messages.</p></remark>
  120. </revision>
  121. <revision>
  122. <version>0.4</version>
  123. <date>2003-05-22</date>
  124. <initials>psa</initials>
  125. <remark><p>Made Thread IDs optional; made &lt;inactive/&gt; and &lt;gone/&gt; states optional if Thread IDs are not used; removed requirement for explicit service discovery in favor of implicit discovery.</p></remark>
  126. </revision>
  127. <revision>
  128. <version>0.3</version>
  129. <date>2003-05-20</date>
  130. <initials>psa</initials>
  131. <remark><p>Clarified terminology; added support for groupchat; added several implementation notes.</p></remark>
  132. </revision>
  133. <revision>
  134. <version>0.2</version>
  135. <date>2003-05-19</date>
  136. <initials>psa</initials>
  137. <remark><p>General cleanup; added schema.</p></remark>
  138. </revision>
  139. <revision>
  140. <version>0.1</version>
  141. <date>2003-05-19</date>
  142. <initials>dss/psa</initials>
  143. <remark><p>Initial version.</p></remark>
  144. </revision>
  145. </header>
  146. <section1 topic='Introduction' anchor='intro'>
  147. <p>Many instant messaging systems include notifications about the state of one's conversation partner in a one-to-one chat (or, sometimes, in a many-to-many chat). Usually these are limited to notification that one's partner is currently typing -- e.g., the Composing event in the older (deprecated) &xep0022; protocol. However, a composing event is essentially information about a person's participation in or involvement with the chat "session" and therefore is really a session-level state rather than a per-message event (in contrast to the Delivered and Displayed events in <cite>XEP-0022</cite>). While the composing event is interesting, the concept of a session-level state can be extended to answer a variety of questions about the participation of a person in a real-time chat conversation, such as:</p>
  148. <ul>
  149. <li>Has this person paused the composition?</li>
  150. <li>Is this person actively paying attention to the chat?</li>
  151. <li>Is this person temporarily inactive (i.e., not paying attention right now)?</li>
  152. <li>Is this person simply gone (i.e., no longer participating in the chat)?</li>
  153. </ul>
  154. <p>To answer such questions, this document supplements the traditional composing state by defining four additional chat states (paused, active, inactive, gone), for a total of five states that (it is hoped) together fully describe the possible states of a person's participation in or involvement with a chat conversation. <note>These states do not necessarily refer to the state of the client interface and certainly not to the disposition of a particular message. However, the user's involvement with the system, device, chat session interface, or input interface can provide important clues regarding the user's involvement with the chat session; these clues can be used by the client in determining when to generate chat state notifications.</note></p>
  155. </section1>
  156. <section1 topic='Definitions' anchor='definitions'>
  157. <p>In essence, chat state notifications can be thought of as a form of chat-specific presence. For example, consider what might happen if a user "loses" a chat window on his desktop; the user might still be interacting with his messaging client (thus never automatically changing his basic presence to "away"), but the user's state with regard to the chat session might change progressively from active to inactive to gone. This information would help the user's conversation partner understand why she has not received a response to her messages in the chat session.</p>
  158. <p>Chat state notifications can appear in two kinds of &MESSAGE; stanzas:</p>
  159. <ul>
  160. <li>A "content message" -- that is, a message stanza whose primary meaning is contained in standard messaging content such as the XMPP &lt;body/&gt; or any other properly-namespaced child element(s) other than those defined for chat state notifications in this specification.</li>
  161. <li>A "standalone notification" -- that is, a message stanza that does not contain standard messaging content but instead is intended to specify only the chat state since it contains only a child element qualified by the "" namespace (or possibly also the XMPP &lt;thread/&gt; element; see the <link url='#bizrules-threads'>Threads</link> section below).</li>
  162. </ul>
  163. <p>The five chat states specified in this document are described below. The suggested triggers are simply that: <em>suggestions</em>. It is up to the implementation to determine when to generate chat state notifications and which notifications to generate.</p>
  164. <table caption='Chat States'>
  165. <tr>
  166. <th>State</th>
  167. <th>Definition</th>
  168. <th>Suggested Triggers</th>
  169. </tr>
  170. <tr>
  171. <td>&lt;active/&gt;</td>
  172. <td>User is actively participating in the chat session.</td>
  173. <td>User accepts an initial content message, sends a content message, gives focus to the chat session interface (perhaps after being inactive), or is otherwise paying attention to the conversation.</td>
  174. </tr>
  175. <tr>
  176. <td>&lt;inactive/&gt;</td>
  177. <td>User has not been actively participating in the chat session.</td>
  178. <td>User has not interacted with the chat session interface for an intermediate period of time (e.g., 2 minutes).</td>
  179. </tr>
  180. <tr>
  181. <td>&lt;gone/&gt;</td>
  182. <td>User has effectively ended their participation in the chat session.</td>
  183. <td>User has not interacted with the chat session interface, system, or device for a relatively long period of time (e.g., 10 minutes).</td>
  184. </tr>
  185. <tr>
  186. <td>&lt;composing/&gt;</td>
  187. <td>User is composing a message.</td>
  188. <td>User is actively interacting with a message input interface specific to this chat session (e.g., by typing in the input area of a chat window).</td>
  189. </tr>
  190. <tr>
  191. <td>&lt;paused/&gt;</td>
  192. <td>User had been composing but now has stopped.</td>
  193. <td>User was composing but has not interacted with the message input interface for a short period of time (e.g., 30 seconds).</td>
  194. </tr>
  195. </table>
  196. <p>Note that the &lt;active/&gt;, &lt;inactive/&gt;, and &lt;gone/&gt; states refer to the overall chat session interface whereas the &lt;composing/&gt; and &lt;paused/&gt; states refer to the message input interface (and are in some sense a subset of &lt;active/&gt;). Some implementations might support only events related to the message input interface, some implementations might support only events related to the overall chat session interface, and some implementations might support both kinds of events.</p>
  197. </section1>
  198. <section1 topic='State Chart' anchor='statechart'>
  199. <p>The following figure attempts to capture the most common state transitions in visual form (all four of the states shown can also transition to the GONE state).</p>
  200. <code><![CDATA[
  201. o (start)
  202. |
  203. |
  205. | |
  206. | |
  207. +---<---<---<---<---<---<---<---<---<---+
  208. ]]></code>
  209. <p>Note: Other transitions are not forbidden if the developers of an implementation feel that such transitions are desirable (e.g., INACTIVE to PAUSED if a user returns to a chat session interface containing an unfinished message).</p>
  210. </section1>
  211. <section1 topic='Determining Support' anchor='support'>
  212. <p>If an entity supports the Chat State Notifications protocol, it MUST advertise that fact in its responses to &xep0030; information ("disco#info") requests by returning a feature of "":</p>
  213. <example caption='A disco#info query'><![CDATA[
  214. <iq from='romeo@shakespeare.lit/orchard'
  215. id='disco1'
  216. to=''
  217. type='get'>
  218. <query xmlns=''/>
  219. </iq>
  220. ]]></example>
  221. <example caption='A disco#info response'><![CDATA[
  222. <iq from=''
  223. id='disco1'
  224. to='romeo@shakespeare.lit/orchard'
  225. type='result'>
  226. <query xmlns=''>
  227. <feature var=''/>
  228. </query>
  229. </iq>
  230. ]]></example>
  231. <p>In order for an application to determine whether an entity supports this protocol, where possible it SHOULD use the dynamic, presence-based profile of service discovery defined in &xep0115;. However, if an application has not received entity capabilities information from an entity, it SHOULD use explicit service discovery instead.</p>
  232. </section1>
  233. <section1 topic='Business Rules' anchor='bizrules'>
  234. <section2 topic='Generation of Notifications' anchor='bizrules-gen'>
  235. <p>Before generating chat state notifications, a User SHOULD explicitly discover whether the Contact supports the protocol defined herein (as described in the <link url='#disco'>Discovering Support</link> section of this document) or explicitly negotiate the use of chat state notifications with the Contact (e.g., via &xep0155;).</p>
  236. <p>In the absence of explicit discovery or negotiation, the User MAY implicitly request and discover the use of chat state notifications in a one-to-one chat session by adhering to the following business rules:</p>
  237. <ol start='1'>
  238. <li>If the User desires chat state notifications, the message(s) that it sends to the Contact before receiving a reply MUST contain a chat state notification extension, which SHOULD be &lt;active/&gt;.</li>
  239. <li>If the Contact replies but does not include a chat state notification extension, the User MUST NOT send subsequent chat state notifications to the Contact.</li>
  240. <li>If the Contact replies and includes an &lt;active/&gt; notification (or sends a standalone notification to the User), the User and Contact SHOULD send subsequent notifications for supported chat states (as specified in the next subsection) by including an &lt;active/&gt; notification in each content message and sending standalone notifications for the chat states they support (at a minimum, the &lt;composing/&gt; state).</li>
  241. </ol>
  242. <p>The foregoing rules imply that the sending of chat state notifications is bidirectional (i.e., both User and Contact will either send or not send chat state notifications) rather than unidirectional (i.e., one of the conversation partners will send chat state notifications but the other will not); this is by design.</p>
  243. </section2>
  244. <section2 topic='Support Requirements' anchor='bizrules-support'>
  245. <table caption='Requirements for Supporting Each Chat State'>
  246. <tr>
  247. <th>Chat State</th>
  248. <th>Requirement</th>
  249. </tr>
  250. <tr>
  251. <td>&lt;active/&gt;</td>
  252. <td>MUST</td>
  253. </tr>
  254. <tr>
  255. <td>&lt;composing/&gt;</td>
  256. <td>MUST</td>
  257. </tr>
  258. <tr>
  259. <td>&lt;paused/&gt;</td>
  260. <td>SHOULD</td>
  261. </tr>
  262. <tr>
  263. <td>&lt;inactive/&gt;</td>
  264. <td>SHOULD</td>
  265. </tr>
  266. <tr>
  267. <td>&lt;gone/&gt;</td>
  268. <td>SHOULD</td>
  269. </tr>
  270. </table>
  271. <p>A client MUST allow users to configure whether they want to send chat state notifications.</p>
  272. <p>Note: Support for only &lt;active/&gt; and &lt;composing/&gt; is functionally equivalent to supporting the Composing event from <cite>XEP-0022</cite>.</p>
  273. </section2>
  274. <section2 topic='Repetition' anchor='bizrules-rep'>
  275. <p>Even if the user types continuously for a long time (e.g., while composing a lengthy reply), the client MUST NOT send more than one standalone &lt;composing/&gt; notification in a row. More generally, a client MUST NOT send a second instance of any given standalone notification (i.e., a standalone notification MUST be followed by a different state, not repetition of the same state). However, every content message SHOULD contain an &lt;active/&gt; notification.</p>
  276. </section2>
  277. <section2 topic='Context of Usage' anchor='bizrules-context'>
  278. <ol>
  279. <li>This protocol MUST NOT be used with stanzas other than &MESSAGE;.</li>
  280. <li>This protocol SHOULD NOT be used with message types other than "chat" or "groupchat".</li>
  281. <li>The 'type' attribute for content messages and standalone notifications SHOULD be set to a value of "chat" (for one-to-one sessions) or "groupchat" (for many-to-many sessions).</li>
  282. <li>A chat session MAY span multiple user sessions (i.e., chat state is orthogonal to the presence of one's conversation partner), although this is unlikely given the suggested timing of event triggers.</li>
  283. </ol>
  284. </section2>
  285. <section2 topic='Use in Groupchat' anchor='bizrules-groupchat'>
  286. <p>Chat state notifications MAY be sent in the context of groupchat rooms (e.g., as defined in &xep0045;). The following business rules apply:</p>
  287. <ol>
  288. <li>A client MAY send chat state notifications even if not all room occupants do so.</li>
  289. <li>A client SHOULD NOT generate &lt;gone/&gt; notifications.</li>
  290. <li>A client SHOULD ignore &lt;gone/&gt; notifications received from other room occupants.</li>
  291. </ol>
  292. <p>Note: Use of chat state notifications in the context of groupchat can result in multicasting of such notifications. Forewarned is forearmed.</p>
  293. </section2>
  294. <section2 topic='Syntax of Notifications' anchor='bizrules-syntax'>
  295. <ol>
  296. <li>A message stanza MUST NOT contain more than one child element qualified by the '' namespace.</li>
  297. <li>A message stanza that contains standard instant messaging content SHOULD NOT contain a chat state notification extension other than &lt;active/&gt;, where "standard instant messaging content" is taken to mean the &lt;body/&gt;, &lt;subject/&gt;, and &lt;thread/&gt; child elements defined in &xmppim; or any other child element that would lead the recipient to treat the stanza as an instant message as explained in &xep0226;.</li>
  298. <li>A message stanza that does not contain standard messaging content and is intended to specify only the chat state MUST NOT contain any child elements other than the chat state notification extension, which SHOULD be a state other than &lt;active/&gt;; however, if threads are used (see below) then the standalone notification MUST also contain the &lt;thread/&gt; element.</li>
  299. </ol>
  300. </section2>
  301. <section2 topic='Threads' anchor='bizrules-threads'>
  302. <p>While chat state notifications provide a mechanism for managing chat threads as communicated by inclusion of the XMPP &lt;thread/&gt; element, support for threads is OPTIONAL (for further information about threads, refer to &xep0201;). However, if all of the clients participating in a chat both support and use threads, the following additional business rules apply:</p>
  303. <ol>
  304. <li>Clients MUST copy back Thread IDs (i.e., the value of the &lt;thread/&gt; element) in any replies.</li>
  305. <li>When a client terminates a one-to-one chat session (e.g., when a user closes the chat session interface), it MUST generate a &lt;gone/&gt; event.</li>
  306. <li>Upon receiving a &lt;gone/&gt; event, a client MUST NOT re-use the same Thread ID and MUST generate a new Thread ID for any subsequent chat messages sent to the conversation partner.</li>
  307. </ol>
  308. </section2>
  309. <section2 topic='Server Handling of Notifications' anchor='bizrules-notify'>
  310. <p>Servers in constrained network environments (e.g., serving small-footprint clients via &xep0025; or &xep0124;) and services that rebroadcast message stanzas (e.g., Multi-User Chat services) MAY process standalone notifications differently from other messages. In particular, a server or service MAY refuse to deliver standalone notifications to its users, and SHOULD NOT store them offline. In contrast to <cite>XEP-0022</cite>, chat state notifications are completely the responsibility of the client, and MUST NOT be generated by a server or service.</p>
  311. </section2>
  312. </section1>
  313. <section1 topic='A Simple Example' anchor='example-basic'>
  314. <p>In the following conversation, both User &lt;bernardo@shakespeare.lit&gt; and Contact &lt;francisco@shakespeare.lit&gt; support chat state notifications.</p>
  315. <example caption="User Sends Initial Content Message With &lt;active/&gt; Notification"><![CDATA[
  316. <message
  317. from='bernardo@shakespeare.lit/pda'
  318. to='francisco@shakespeare.lit'
  319. type='chat'>
  320. <body>Who's there?</body>
  321. <active xmlns=''/>
  322. </message>
  323. ]]></example>
  324. <example caption="Contact's Client Sends Content Message Reply With &lt;active/&gt; Notification"><![CDATA[
  325. <message
  326. from='francisco@shakespeare.lit/elsinore'
  327. to='bernardo@shakespeare.lit/pda'
  328. type='chat'>
  329. <body>Nay, answer me: stand, and unfold yourself.</body>
  330. <active xmlns=''/>
  331. </message>
  332. ]]></example>
  333. <p>Because the User now knows that the Contact supports chat state notifications, the User can send other notification types.</p>
  334. <example caption="User Sends Standalone &lt;composing/&gt; Notification"><![CDATA[
  335. <message
  336. from='bernardo@shakespeare.lit/pda'
  337. to='francisco@shakespeare.lit/elsinore'
  338. type='chat'>
  339. <composing xmlns=''/>
  340. </message>
  341. ]]></example>
  342. <example caption="User Sends a Content Message Reply With &lt;active/&gt; Notification"><![CDATA[
  343. <message
  344. from='bernardo@shakespeare.lit/pda'
  345. to='francisco@shakespeare.lit/elsinore'
  346. type='chat'>
  347. <body>Long live the king!</body>
  348. <active xmlns=''/>
  349. </message>
  350. ]]></example>
  351. <p>And so forth.</p>
  352. </section1>
  353. <section1 topic='A Detailed Conversation' anchor='example-detail'>
  354. <p>The following conversation flow illustrates in more detail the workings of chat state notifications (in this case also using threads) between a User &lt;romeo@shakespeare.lit&gt; and a Contact &lt;;.</p>
  355. <example caption="User Sends Initial Content Message"><![CDATA[
  356. <message
  357. from='romeo@shakespeare.lit/orchard'
  358. to=''
  359. type='chat'>
  360. <thread>act2scene2chat1</thread>
  361. <body>
  362. I take thee at thy word:
  363. Call me but love, and I'll be new baptized;
  364. Henceforth I never will be Romeo.
  365. </body>
  366. <active xmlns=''/>
  367. </message>
  368. ]]></example>
  369. <p>At this point Juliet's client knows that Romeo's client supports chat state notifications. Thus she replies to the content message and her client includes a notification that her state is &lt;active/&gt;:</p>
  370. <example caption="Contact's Client Sends Content Message Reply With &lt;active/&gt; Notification"><![CDATA[
  371. <message
  372. from=''
  373. to='romeo@shakespeare.lit/orchard'
  374. type='chat'>
  375. <thread>act2scene2chat1</thread>
  376. <body>
  377. What man art thou that thus bescreen'd in night
  378. So stumblest on my counsel?
  379. </body>
  380. <active xmlns=''/>
  381. </message>
  382. ]]></example>
  383. <p>And so the conversation continues. After a while, Juliet asks a question that brings Romeo up short:</p>
  384. <example caption="Contact Sends Another Message"><![CDATA[
  385. <message
  386. from=''
  387. to='romeo@shakespeare.lit/orchard'
  388. type='chat'>
  389. <thread>act2scene2chat1</thread>
  390. <body>Art thou not Romeo, and a Montague?</body>
  391. </message>
  392. ]]></example>
  393. <p>Romeo begins composing a reply to Juliet's heartfelt question, and his client notifies Juliet that he is composing a reply.</p>
  394. <example caption="User's Client Sends Standalone &lt;composing/&gt; Notification"><![CDATA[
  395. <message
  396. from=''
  397. to=''
  398. type='chat'>
  399. <thread>act2scene2chat1</thread>
  400. <composing xmlns=''/>
  401. </message>
  402. ]]></example>
  403. <p>Romeo realizes his reply is too rash and pauses to choose the right words; after some (configurable) time period, his client senses the delay and sends a state of &lt;paused/&gt;.</p>
  404. <example caption="User's Client Sends Standalone &lt;paused/&gt; Notification"><![CDATA[
  405. <message
  406. from=''
  407. to=''
  408. type='chat'>
  409. <thread>act2scene2chat1</thread>
  410. <paused xmlns=''/>
  411. </message>
  412. ]]></example>
  413. <p>Romeo starts composing again, and his Jabber client sends a &lt;composing/&gt; notification to Juliet's client.</p>
  414. <example caption="User's Clients Sends Standalone &lt;composing/&gt; Notification"><![CDATA[
  415. <message
  416. from=''
  417. to=''
  418. type='chat'>
  419. <thread>act2scene2chat1</thread>
  420. <composing xmlns=''/>
  421. </message>
  422. ]]></example>
  423. <p>Romeo finally sends his reply.</p>
  424. <example caption="User Replies"><![CDATA[
  425. <message
  426. from=''
  427. to=''
  428. type='chat'>
  429. <thread>act2scene2chat1</thread>
  430. <body>Neither, fair saint, if either thee dislike.</body>
  431. <active xmlns=''/>
  432. </message>
  433. ]]></example>
  434. <p>The conversation ebbs and flows, waxes and wanes, until Juliet is called away by her Nurse...</p>
  435. <example caption="Contact's Client Sends Content Message"><![CDATA[
  436. <message
  437. from=''
  438. to='romeo@shakespeare.lit/orchard'
  439. type='chat'>
  440. <thread>act2scene2chat1</thread>
  441. <body>
  442. I hear some noise within; dear love, adieu!
  443. Anon, good nurse! Sweet Montague, be true.
  444. Stay but a little, I will come again.
  445. </body>
  446. <active xmlns=''/>
  447. </message>
  448. ]]></example>
  449. <p>We suppose that Juliet minimizes the chat window, so her client generates an &lt;inactive/&gt; notification:</p>
  450. <example caption="Contact's Client Sends Standalone &lt;inactive/&gt; Notification"><![CDATA[
  451. <message
  452. from=''
  453. to='romeo@shakespeare.lit/orchard'
  454. type='chat'>
  455. <thread>act2scene2chat1</thread>
  456. <inactive xmlns=''/>
  457. </message>
  458. ]]></example>
  459. <p>When she returns and brings the window up again, her client generates an &lt;active/&gt; notification:</p>
  460. <example caption="Contact's Client Sends Standalone &lt;active/&gt; Notification"><![CDATA[
  461. <message
  462. from=''
  463. to='romeo@shakespeare.lit/orchard'
  464. type='chat'>
  465. <thread>act2scene2chat1</thread>
  466. <active xmlns=''/>
  467. </message>
  468. ]]></example>
  469. <p>The conversation continues, but Juliet is called away again by that nagging Nurse:</p>
  470. <example caption="Contact's Client Sends Content Message"><![CDATA[
  471. <message
  472. from=''
  473. to='romeo@shakespeare.lit/orchard'
  474. type='chat'>
  475. <thread>act2scene2chat1</thread>
  476. <body>
  477. A thousand times good night!
  478. </body>
  479. <active xmlns=''/>
  480. </message>
  481. ]]></example>
  482. <p>We suppose that Juliet closes the chat window, so her client generates a &lt;gone/&gt; notification:</p>
  483. <example caption="Contact's Client Sends Standalone &lt;gone/&gt; Notification"><![CDATA[
  484. <message
  485. from=''
  486. to='romeo@shakespeare.lit/orchard'
  487. type='chat'>
  488. <thread>act2scene2chat1</thread>
  489. <gone xmlns=''/>
  490. </message>
  491. ]]></example>
  492. <p>Romeo's client now considers the chat thread to be over and generates a new Thread ID when he sends a new message:</p>
  493. <example caption="User's Client Sends Content Message with New Thread ID"><![CDATA[
  494. <message
  495. from='romeo@shakespeare.lit/orchard'
  496. to=''
  497. type='chat'>
  498. <thread>act2scene2chat2</thread>
  499. <body>
  500. A thousand times the worse, to want thy light.
  501. Love goes toward love, as schoolboys from their books,
  502. But love from love, toward school with heavy looks.
  503. </body>
  504. <active xmlns=''/>
  505. </message>
  506. ]]></example>
  507. <p>When Juliet returns to her computer on the balcony, she finds the new message from Romeo. When she finishes her reply, her client includes both an &lt;active/&gt; notification and the new Thread ID with the body of her reply:</p>
  508. <example caption="Contact's Client Sends Content Message"><![CDATA[
  509. <message
  510. from=''
  511. to='romeo@shakespeare.lit/orchard'
  512. type='chat'>
  513. <thread>act2scene2chat2</thread>
  514. <body>
  515. Hist! Romeo, hist! O, for a falconer's voice,....
  516. </body>
  517. <active xmlns=''/>
  518. </message>
  519. ]]></example>
  520. <p>And so forth.</p>
  521. <p>My, these star-crossed lovers do go on, don't they?</p>
  522. </section1>
  523. <section1 topic='Implementation Notes' anchor='impl'>
  524. <p>A client that receives a chat state notification might never receive another message or chat state notification from the other entity (e.g., because the other entity crashes or goes offline) and needs to plan accordingly.</p>
  525. </section1>
  526. <section1 topic='Security Considerations' anchor='security'>
  527. <p>The states of a chat thread can reveal information about a user's interaction with his or her computer, including his or her physical presence; such information SHOULD NOT be revealed to conversation partners who are not trusted to know such information. Client implementations MUST provide a mechanism that enables the user to disable chat state notifications if desired.</p>
  528. </section1>
  529. <section1 topic='IANA Considerations' anchor='iana'>
  530. <p>This document requires no interaction with &IANA;.</p>
  531. </section1>
  532. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  533. <section2 topic='Protocol Namespaces' anchor='registrar-ns'>
  534. <p>The &REGISTRAR; includes '' in its registry of protocol namespaces.</p>
  535. </section2>
  536. </section1>
  537. <section1 topic='XML Schema' anchor='schema'>
  538. <code><![CDATA[
  539. <?xml version='1.0' encoding='UTF-8'?>
  540. <xs:schema
  541. xmlns:xs=''
  542. targetNamespace=''
  543. xmlns=''
  544. elementFormDefault='qualified'>
  545. <xs:annotation>
  546. <xs:documentation>
  547. The protocol documented by this schema is defined in
  548. XEP-0085:
  549. </xs:documentation>
  550. </xs:annotation>
  551. <xs:element name='active' type='empty'/>
  552. <xs:element name='composing' type='empty'/>
  553. <xs:element name='gone' type='empty'/>
  554. <xs:element name='inactive' type='empty'/>
  555. <xs:element name='paused' type='empty'/>
  556. <xs:simpleType name='empty'>
  557. <xs:restriction base='xs:string'>
  558. <xs:enumeration value=''/>
  559. </xs:restriction>
  560. </xs:simpleType>
  561. </xs:schema>
  562. ]]></code>
  563. </section1>
  564. </xep>