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-0307.xml 4.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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>Unique Room Names for Multi-User Chat</title>
  10. <abstract>This specification defines an XMPP protocol extension for requesting a unique room ID from a multi-user chat service.</abstract>
  11. &LEGALNOTICE;
  12. <number>0307</number>
  13. <status>Deferred</status>
  14. <type>Standards Track</type>
  15. <sig>Standards</sig>
  16. <dependencies>
  17. <spec>XMPP Core</spec>
  18. <spec>XEP-0045</spec>
  19. </dependencies>
  20. <supersedes/>
  21. <supersededby/>
  22. <shortname>muc-unique</shortname>
  23. <schemaloc>
  24. <url>http://www.xmpp.org/schemas/muc-unique.xsd</url>
  25. </schemaloc>
  26. &stpeter;
  27. <revision>
  28. <version>0.1</version>
  29. <date>2011-11-10</date>
  30. <initials>psa</initials>
  31. <remark><p>Initial published version.</p></remark>
  32. </revision>
  33. <revision>
  34. <version>0.0.1</version>
  35. <date>2011-09-26</date>
  36. <initials>psa</initials>
  37. <remark><p>First version, moved from XEP-0045.</p></remark>
  38. </revision>
  39. </header>
  40. <section1 topic='Introduction' anchor='intro'>
  41. <p>&xep0045; defines the protocol for groupchat in XMPP. In some situations, the room creator may want to request a unique room name before attempting to create the room (e.g., to avoid the possibility of a room conflict). Naturally, one way to do so is for the creator's client to generate a globally unique identifier, for example as defined in &rfc4122;. Another way is for the client to ask the MUC service for a unique room ID (which the service will thus reserve for that user).</p>
  42. </section1>
  43. <section1 topic='Protocol' anchor='proto'>
  44. <p>The room creator requests a unique room name by sending an IQ-get to the service itself, containing an empty &lt;unique/&gt; element qualified by the 'http://jabber.org/protocol/muc#unique' namespace:</p>
  45. <example caption='Entity Requests Unique Room Name'><![CDATA[
  46. <iq from='crone1@shakespeare.lit/desktop'
  47. id='unique1'
  48. to='chat.shakespeare.lit'
  49. type='get'>
  50. <unique xmlns='http://jabber.org/protocol/muc#unique'/>
  51. </iq>
  52. ]]></example>
  53. <p>If the service supports this feature, it SHOULD return a unique room name as the XML character data of the &lt;unique/&gt; element (but not create the room):</p>
  54. <example caption='Service Returns Unique Room Name'><![CDATA[
  55. <iq from='chat.shakespeare.lit'
  56. id='unique1'
  57. to='crone1@shakespeare.lit/desktop'
  58. type='result'>
  59. <unique xmlns='http://jabber.org/protocol/muc#unique'>
  60. 6d9423a55f499b29ad20bf7b2bdea4f4b885ead1
  61. </unique>
  62. </iq>
  63. ]]></example>
  64. <p>The service MAY refuse to return a unique room name to entities that are not entitled to create rooms, entities that have sent an excessive number of requests for unique room names, etc.</p>
  65. <p>The service MAY use any algorithm that ensures the creation of a room name that will be permanently unique in the context of the service (e.g., a cryptographic hash of the requesting JID, datetime, and random salt), or simply use a UUID as defined by <cite>RFC 4122</cite>.</p>
  66. <p>The room creator would then use the XML character data of the &lt;unique/&gt; element as the node identifier portion of the room JID it requests:</p>
  67. <example caption='Owner Creates Room With Unique Name'><![CDATA[
  68. <presence
  69. from='crone1@shakespeare.lit/desktop'
  70. to='6d9423a55f499b29ad20bf7b2bdea4f4b885ead1@chat.shakespeare.lit/firstwitch'>
  71. <x xmlns='http://jabber.org/protocol/muc'/>
  72. </presence>
  73. ]]></example>
  74. </section1>
  75. <section1 topic='Determining Support' anchor='support'>
  76. <p>If a MUC service supports the protocol specified herein, it MUST advertise that fact by returning a feature of "http://jabber.org/protocol/muc#unique" in response to &xep0030; information requests &NSNOTE;.</p>
  77. <example caption="Service discovery information request"><![CDATA[
  78. <iq from='crone1@shakespeare.lit/desktop'
  79. id='disco1'
  80. to='chat.shakespeare.lit'
  81. type='get'>
  82. <query xmlns='http://jabber.org/protocol/disco#info'/>
  83. </iq>
  84. ]]></example>
  85. <example caption="Service discovery information response"><![CDATA[
  86. <iq from='chat.shakespeare.lit'
  87. id='disco1'
  88. to='crone1@shakespeare.lit/desktop'
  89. type='result'>
  90. <query xmlns='http://jabber.org/protocol/disco#info'>
  91. [...]
  92. <feature var='http://jabber.org/protocol/muc#unique'/>
  93. [...]
  94. </query>
  95. </iq>
  96. ]]></example>
  97. </section1>
  98. <section1 topic='XML Schema' anchor='schema'>
  99. <code><![CDATA[
  100. <?xml version='1.0' encoding='UTF-8'?>
  101. <xs:schema
  102. xmlns:xs='http://www.w3.org/2001/XMLSchema'
  103. targetNamespace='http://jabber.org/protocol/muc#unique'
  104. xmlns='http://jabber.org/protocol/muc#unique'
  105. elementFormDefault='qualified'>
  106. <xs:element name='unique' type='xs:string'/>
  107. </xs:schema>
  108. ]]></code>
  109. </section1>
  110. </xep>