-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxep-0307.xml
117 lines (110 loc) · 4.72 KB
/
xep-0307.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE xep SYSTEM 'xep.dtd' [
<!ENTITY % ents SYSTEM 'xep.ent'>
%ents;
]>
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
<xep>
<header>
<title>Unique Room Names for Multi-User Chat</title>
<abstract>This specification defines an XMPP protocol extension for requesting a unique room ID from a multi-user chat service.</abstract>
&LEGALNOTICE;
<number>0307</number>
<status>Deferred</status>
<type>Standards Track</type>
<sig>Standards</sig>
<dependencies>
<spec>XMPP Core</spec>
<spec>XEP-0045</spec>
</dependencies>
<supersedes/>
<supersededby/>
<shortname>muc-unique</shortname>
<schemaloc>
<url>http://www.xmpp.org/schemas/muc-unique.xsd</url>
</schemaloc>
&stpeter;
<revision>
<version>0.1</version>
<date>2011-11-10</date>
<initials>psa</initials>
<remark><p>Initial published version.</p></remark>
</revision>
<revision>
<version>0.0.1</version>
<date>2011-09-26</date>
<initials>psa</initials>
<remark><p>First version, moved from XEP-0045.</p></remark>
</revision>
</header>
<section1 topic='Introduction' anchor='intro'>
<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>
</section1>
<section1 topic='Protocol' anchor='proto'>
<p>The room creator requests a unique room name by sending an IQ-get to the service itself, containing an empty <unique/> element qualified by the 'http://jabber.org/protocol/muc#unique' namespace:</p>
<example caption='Entity Requests Unique Room Name'><![CDATA[
<iq from='crone1@shakespeare.lit/desktop'
id='unique1'
to='chat.shakespeare.lit'
type='get'>
<unique xmlns='http://jabber.org/protocol/muc#unique'/>
</iq>
]]></example>
<p>If the service supports this feature, it SHOULD return a unique room name as the XML character data of the <unique/> element (but not create the room):</p>
<example caption='Service Returns Unique Room Name'><![CDATA[
<iq from='chat.shakespeare.lit'
id='unique1'
to='crone1@shakespeare.lit/desktop'
type='result'>
<unique xmlns='http://jabber.org/protocol/muc#unique'>
6d9423a55f499b29ad20bf7b2bdea4f4b885ead1
</unique>
</iq>
]]></example>
<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>
<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>
<p>The room creator would then use the XML character data of the <unique/> element as the node identifier portion of the room JID it requests:</p>
<example caption='Owner Creates Room With Unique Name'><![CDATA[
<presence
from='crone1@shakespeare.lit/desktop'
to='6d9423a55f499b29ad20bf7b2bdea4f4b885ead1@chat.shakespeare.lit/firstwitch'>
<x xmlns='http://jabber.org/protocol/muc'/>
</presence>
]]></example>
</section1>
<section1 topic='Determining Support' anchor='support'>
<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>
<example caption="Service discovery information request"><![CDATA[
<iq from='crone1@shakespeare.lit/desktop'
id='disco1'
to='chat.shakespeare.lit'
type='get'>
<query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
]]></example>
<example caption="Service discovery information response"><![CDATA[
<iq from='chat.shakespeare.lit'
id='disco1'
to='crone1@shakespeare.lit/desktop'
type='result'>
<query xmlns='http://jabber.org/protocol/disco#info'>
[...]
<feature var='http://jabber.org/protocol/muc#unique'/>
[...]
</query>
</iq>
]]></example>
</section1>
<section1 topic='XML Schema' anchor='schema'>
<code><![CDATA[
<?xml version='1.0' encoding='UTF-8'?>
<xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='http://jabber.org/protocol/muc#unique'
xmlns='http://jabber.org/protocol/muc#unique'
elementFormDefault='qualified'>
<xs:element name='unique' type='xs:string'/>
</xs:schema>
]]></code>
</section1>
</xep>