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-0372.xml 7.3KB

  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. <?xml-stylesheet type="text/css" href="xmpp.css"?>
  8. <xep>
  9. <header>
  10. <title>References</title>
  11. <abstract>This document defines a method for one XMPP stanza to provide references to another entity, such as mentioning users, HTTP resources, or other XMPP resources.</abstract>
  13. <number>0372</number>
  14. <status>Deferred</status>
  15. <type>Standards Track</type>
  16. <sig>Standards</sig>
  17. <approver>Council</approver>
  18. <dependencies>
  19. <spec>XMPP Core</spec>
  20. <spec>XMPP IM</spec>
  21. <spec>XEP-0030</spec>
  22. <spec>XEP-0115</spec>
  23. </dependencies>
  24. <supersedes/>
  25. <supersededby/>
  26. <shortname>Refs</shortname>
  27. &ksmithisode;
  28. <revision>
  29. <version>0.2</version>
  30. <date>2017-09-11</date>
  31. <initials>XEP Editor (jwi)</initials>
  32. <remark>Defer due to lack of activity.</remark>
  33. </revision>
  34. <revision>
  35. <version>0.1</version>
  36. <date>2016-03-22</date>
  37. <initials>XEP Editor (asw)</initials>
  38. <remark><p>Initial published version approved by the XMPP Council.</p></remark>
  39. </revision>
  40. <revision>
  41. <version>0.0.1</version>
  42. <date>2016-01-29</date>
  43. <initials>kis</initials>
  44. <remark><p>First draft.</p></remark>
  45. </revision>
  46. </header>
  47. <section1 topic='Introduction' anchor='intro'>
  48. <p>
  49. It's often desirable to encode a reference to another entity within a chat message and to mark up the reference. Examples of this include HTTP URLs, 'mentions' (referring to another user), references to previous messages and references to &xep0346; (FDP) forms. This document provides a mechanism for marking up a section of a message body with information about the target of the reference.
  50. </p>
  51. </section1>
  52. <!--<section1 topic='Requirements' anchor='reqs'>
  53. <ul>
  54. <li></li>
  55. </ul>
  56. </section1>-->
  57. <section1 topic='Discovery' anchor='discovery'>
  58. <p>If a client implements references, it MUST specify the 'urn:xmpp:reference:0' feature in its service discovery information features as specified in &xep0030; and the Entity Capabilities profile specified in &xep0115;.</p>
  59. <example caption='Client queries for contact&apos;s features'><![CDATA[
  60. <iq type='get'
  61. id='disco1'
  62. from='romeo@montegue.lit/30d3d8'
  63. to='juliet@capulet.lit/sabo239'>
  64. <query xmlns=''/>
  65. </iq>
  66. ]]></example>
  67. <example caption='Contact&apos;s client responds with features'><![CDATA[
  68. <iq type='result'
  69. id='disco1'
  70. from='juliet@capulet.lit/sabo239'
  71. to='romeo@montegue.lit/30d3d8'>
  72. <query xmlns=''>
  73. ...
  74. <feature var='urn:xmpp:reference:0'/>
  75. ...
  76. </query>
  77. </iq>
  78. ]]></example>
  79. <p>TODO: Individual discovery of reference types - FDP, Mentions, ...</p>
  80. </section1>
  81. <section1 topic='Use Cases' anchor='usecases'>
  82. <section2 topic='Generics' anchor='usecase_generics'>
  83. <p>References are provided in a 'reference' element of a message, with a namespace of 'urn:xmpp:reference:0'. The element MUST contain a type attribute denoting the type of the reference and a uri attribute of the thing that is referenced. It MAY contain begin, end and anchor elements. A begin attribute is used to mark the index in the body of the referring message of the first character (TODO: define character appropriately) in the reference, with 0 being the index of the first character. An end attribute is similarly used for the index of the last character of the reference. Where the reference is not a substring of the message body in the referring stanza, begin and end are not used. An anchor attribute is used when the referring message is not the one containing the reference element, and points to the previous message containing the reference (the referring message).</p>
  84. <p>Note that the URIs of the reference and anchor do not need to refer to the same mechanism as that in which the reference was received. E.g., a service could listen for mentions in a MIX channels of users outside that channel, and send them messages containing a reference to let them know that they've been mentioned.</p>
  85. </section2>
  86. <section2 topic='Mentions' anchor='usecase_mention'>
  87. <p>Mentions are a reference to a user's bare JID, and have a type of 'mention'.</p>
  88. <example caption='Romeo sends a message mentioning Juliet'><![CDATA[
  89. <message type='groupchat'
  90. id='sotehu-bthbtp32h3'
  91. to='balcony@channels.shakespeare.lit'>
  92. <body>But, soft! what light through yonder window breaks? It is the east, and Juliet is the sun.</body>
  93. <reference xmlns='urn:xmpp:reference:0'
  94. begin='72'
  95. end='78'
  96. type='mention'
  97. uri='xmpp:juliet@capulet.lit'/>
  98. </message>
  99. ]]></example>
  100. </section2>
  101. <section2 topic='Data' anchor='usecase_data'>
  102. <p>Data references are a generic reference without additional information. The URI points to an 'item' that is able to be fetched. This is useful for, for example, fetching an item from pubsub, as in the example below. TODO: check URI syntax for refering to a pubsub item.</p>
  103. <example caption='A MIX Channel sends a message that a new FDP form has been submitted elsewhere'><![CDATA[
  104. <message type='groupchat'
  105. id='sotehu-bthbtp32h4'
  106. from='balcony@channels.shakespeare.lit'
  107. to='romeo@montegue.lit/30d3d8'>
  108. <body>Form received</body>
  109. <reference xmlns='urn:xmpp:reference:0'
  110. type='data'
  111. uri='xmpp:fdp.shakespeare.lit?node=fdp/submitted/'/>
  112. </message>
  113. ]]></example>
  114. </section2>
  115. <section2 topic='Previous messages' anchor='usecase_previous'>
  116. <p>Sometimes it's desirable to annotate a reference in a previous message. An example of this might be where a MIX channel asynchronously adds information about references made in previous messages by users. In this case the message MUST NOT contain a body. Here the anchor attribute is used to provide a URI to the previous message. TODO: URI scheme for messages.</p>
  117. <example caption='A MIX Channel annotates a previous user message'><![CDATA[
  118. <message type='groupchat'
  119. id='sotehu-bthbtp32h5'
  120. from='balcony@channels.shakespeare.lit'
  121. to='romeo@montegue.lit/30d3d8'>
  122. <reference xmlns='urn:xmpp:reference:0'
  123. type='data'
  124. anchor='xmpp:balcony@channels.shakespeare.lit?node=messages&item=bnhob'
  125. begin='72'
  126. end='78'
  127. uri='xmpp:fdp.shakespeare.lit?node=fdp/submitted/'/>
  128. </message>
  129. ]]></example>
  130. </section2>
  131. </section1>
  132. <!--<section1 topic='Business Rules' anchor='rules'>
  133. <ul>
  134. <li>.</li>
  135. </ul>
  136. </section1>-->
  137. <!--<section1 topic='Implementation Notes' anchor='impl'>
  138. <p>OPTIONAL.</p>
  139. </section1>
  140. <section1 topic='Accessibility Considerations' anchor='access'>
  141. <p>OPTIONAL.</p>
  142. </section1>
  143. <section1 topic='Internationalization Considerations' anchor='i18n'>
  144. <p>OPTIONAL.</p>
  145. </section1>-->
  146. <section1 topic='Security Considerations' anchor='security'>
  147. <p>TODO.</p>
  148. </section1>
  149. <section1 topic='IANA Considerations' anchor='iana'>
  150. <p>None.</p>
  151. </section1>
  152. <section1 topic='XMPP Registrar Considerations' anchor='registrar'>
  153. <p>Needs a namespace.</p>
  154. </section1>
  155. <section1 topic='XML Schema' anchor='schema'>
  156. <p>When advanced.</p>
  157. </section1>
  158. </xep>