corrected example

git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@1805 4b5297f7-1745-476d-ba37-a9c6900126ab
This commit is contained in:
Peter Saint-Andre 2008-04-22 18:39:11 +00:00
parent 91c3e4e328
commit ebf4cabbff
1 changed files with 24 additions and 25 deletions

View File

@ -146,18 +146,18 @@
<c xmlns='http://jabber.org/protocol/caps'
hash='sha-1'
node='http://code.google.com/p/exodus'
ver='SrFo9ar2CCk2EnOH4q4QANeuxLQ='/>
ver='QgayPKawpkPSDYmwT/WM94uAlu0='/>
</presence>
]]></code>
<p>The 'node' attribute represents the client software Romeo is using. The 'ver' attribute is a specially-constructed string (called a "verification string") that represents the entity's service discovery identity (category and type as registered at &DISCOCATEGORIES;, as well as, optionally, xml:lang and name) and supported features (as registered at &DISCOFEATURES; as well as, optionally, extended service discovery information data registered at &FORMTYPES;).</p>
<p>At this point, your client has no idea what the capabilities are of someone with a version string 'SrFo9ar2CCk2EnOH4q4QANeuxLQ='. Your client therefore sends a service discovery query to Romeo, asking what his client can do.</p>
<p>At this point, your client has no idea what the capabilities are of someone with a version string 'QgayPKawpkPSDYmwT/WM94uAlu0='. Your client therefore sends a service discovery query to Romeo, asking what his client can do.</p>
<code><![CDATA[
<iq from='juliet@capulet.lit/chamber'
id='disco1'
to='romeo@montague.lit/orchard'
type='get'>
<query xmlns='http://jabber.org/protocol/disco#info'
node='http://code.google.com/p/exodus#SrFo9ar2CCk2EnOH4q4QANeuxLQ='/>
node='http://code.google.com/p/exodus#QgayPKawpkPSDYmwT/WM94uAlu0='/>
</iq>
]]></code>
<p>The response is:</p>
@ -167,21 +167,22 @@
to='juliet@capulet.lit/chamber'
type='result'>
<query xmlns='http://jabber.org/protocol/disco#info'
node='http://code.google.com/p/exodus#SrFo9ar2CCk2EnOH4q4QANeuxLQ='>
node='http://code.google.com/p/exodus#QgayPKawpkPSDYmwT/WM94uAlu0='>
<identity category='client' name='Exodus 0.9.1' type='pc'/>
<feature var='http://jabber.org/protocol/caps'/>
<feature var='http://jabber.org/protocol/disco#info'/>
<feature var='http://jabber.org/protocol/disco#items'/>
<feature var='http://jabber.org/protocol/muc'/>
</query>
</iq>
]]></code>
<p>At this point, your client knows that anyone advertising a version string of 'SrFo9ar2CCk2EnOH4q4QANeuxLQ=' has a client that can do &xep0045; and the other features returned by Romeo's client (the string can be relied upon because of how it is generated and checked, as explained later in this document). Your client remembers this information, so that it does not need to explicitly query the capabilities of a contact with the same version string. For example, your Nurse may use the same client that Romeo does:</p>
<p>At this point, your client knows that anyone advertising a version string of 'QgayPKawpkPSDYmwT/WM94uAlu0=' has a client that can do &xep0045; and the other features returned by Romeo's client (the string can be relied upon because of how it is generated and checked, as explained later in this document). Your client remembers this information, so that it does not need to explicitly query the capabilities of a contact with the same version string. For example, your Nurse may use the same client that Romeo does:</p>
<code><![CDATA[
<presence from='nurse@capulet.lit/chamber'>
<c xmlns='http://jabber.org/protocol/caps'
hash='sha-1'
node='http://code.google.com/p/exodus'
ver='SrFo9ar2CCk2EnOH4q4QANeuxLQ='/>
ver='QgayPKawpkPSDYmwT/WM94uAlu0='/>
</presence>
]]></code>
<p>Therefore you know that she also supports the same features that Romeo does.</p>
@ -191,7 +192,7 @@
<c xmlns='http://jabber.org/protocol/caps'
hash='sha-1'
node='http://psi-im.org'
ver='8lu+88MRxmKM7yO3MEzY7YmTsWs='/>
ver='q07IKJEyjvHSyhy//CH0CxmKi8w='/>
</presence>
]]></code>
<p>... or the following presence ...</p>
@ -299,9 +300,9 @@
<li>S = ''</li>
<li>Only one identity: "client/pc"</li>
<li>S = 'client/pc//Exodus 0.9.1&lt;'</li>
<li>Sort the features: "http://jabber.org/protocol/disco#info", "http://jabber.org/protocol/disco#items", "http://jabber.org/protocol/muc".</li>
<li>S = 'client/pc//Exodus 0.9.1&lt;http://jabber.org/protocol/disco#info&lt;http://jabber.org/protocol/disco#items&lt;http://jabber.org/protocol/muc&lt;'</li>
<li>ver = SrFo9ar2CCk2EnOH4q4QANeuxLQ=</li>
<li>Sort the features: "http://jabber.org/protocol/caps", "http://jabber.org/protocol/disco#info", "http://jabber.org/protocol/disco#items", "http://jabber.org/protocol/muc".</li>
<li>S = 'client/pc//Exodus 0.9.1&lt;http://jabber.org/protocol/caps&lt;http://jabber.org/protocol/disco#info&lt;http://jabber.org/protocol/disco#items&lt;http://jabber.org/protocol/muc&lt;'</li>
<li>ver = QgayPKawpkPSDYmwT/WM94uAlu0=</li>
</ol>
</section2>
<section2 topic='Complex Generation Example' anchor='ver-gen-complex'>
@ -312,9 +313,10 @@
to='juliet@capulet.lit/chamber'
type='result'&gt;
&lt;query xmlns='http://jabber.org/protocol/disco#info'
node='http://psi-im.org#8lu+88MRxmKM7yO3MEzY7YmTsWs='&gt;
&lt;identity xml:lang='en' category='client' name='Psi 0.9.1' type='pc'/&gt;
&lt;identity xml:lang='el' category='client' name='&#936; 0.9.1' type='pc'/&gt;
node='http://psi-im.org#q07IKJEyjvHSyhy//CH0CxmKi8w='&gt;
&lt;identity xml:lang='en' category='client' name='Psi 0.11' type='pc'/&gt;
&lt;identity xml:lang='el' category='client' name='&#936; 0.11' type='pc'/&gt;
&lt;feature var='http://jabber.org/protocol/caps'/&gt;
&lt;feature var='http://jabber.org/protocol/disco#info'/&gt;
&lt;feature var='http://jabber.org/protocol/disco#items'/&gt;
&lt;feature var='http://jabber.org/protocol/muc'/&gt;
@ -346,18 +348,15 @@
<ol>
<li>S = ''</li>
<li>Two identities: "client/pc/Psi" and "client/pc/&#936;"</li>
<li>S = 'client/pc/el/&#936;&nbsp;0.9.1&lt;client/pc/en/Psi&nbsp;0.9.1&lt;'</li>
<li>S = 'client/pc/el/&#936;&nbsp;0.11&lt;client/pc/en/Psi&nbsp;0.11&lt;'</li>
<li>Sort the features: "http://jabber.org/protocol/caps", http://jabber.org/protocol/disco#info", "http://jabber.org/protocol/disco#items", "http://jabber.org/protocol/muc".</li>
<li>S = 'client/pc/el/&#936;&nbsp;0.9.1&lt;client/pc/en/Psi&nbsp;0.9.1&lt;http://jabber.org/protocol/caps&lt;http://jabber.org/protocol/disco#info
<li>S = 'client/pc/el/&#936;&nbsp;0.11&lt;client/pc/en/Psi&nbsp;0.11&lt;http://jabber.org/protocol/caps&lt;http://jabber.org/protocol/disco#info
<br />&lt;http://jabber.org/protocol/disco#items&lt;http://jabber.org/protocol/muc'.</li>
<li>Sort the extended service discovery forms by FORM_TYPE (there is only one: "urn:xmpp:dataforms:softwareinfo").</li>
<li>S = 'client/pc/el/&#936;&nbsp;0.9.1&lt;client/pc/en/Psi&nbsp;0.9.1&lt;http://jabber.org/protocol/caps&lt;http://jabber.org/protocol/disco#info
<br />&lt;http://jabber.org/protocol/disco#items&lt;http://jabber.org/protocol/muc&lt;urn:xmpp:dataforms:softwareinfo&lt;'</li>
<li>S = 'client/pc/el/&#936;&nbsp;0.11&lt;client/pc/en/Psi&nbsp;0.11&lt;http://jabber.org/protocol/caps&lt;http://jabber.org/protocol/disco#info&lt;http://jabber.org/protocol/disco#items&lt;http://jabber.org/protocol/muc&lt;urn:xmpp:dataforms:softwareinfo&lt;'</li>
<li>Sort the fields by var and append the value(s): "ip_version&lt;ipv4&lt;ipv6", "os&lt;Mac", "os_version&lt;10.5.1", "software&lt;Psi", "software_version&lt;0.11".</li>
<li>S = 'client/pc/el/&#936;&nbsp;0.9.1&lt;client/pc/en/Psi&nbsp;0.9.1&lt;http://jabber.org/protocol/caps
<br/>&lt;http://jabber.org/protocol/disco#info&lt;http://jabber.org/protocol/disco#items&lt;http://jabber.org/protocol/muc
<br/>&lt;urn:xmpp:dataforms:softwareinfo&lt;ip_version&lt;ipv4&lt;ipv6&lt;os&lt;Mac&lt;os_version&lt;10.5.1&lt;software&lt;Psi&lt;software_version&lt;0.11&lt;'</li>
<li>ver = 8lu+88MRxmKM7yO3MEzY7YmTsWs=</li>
<li>S = 'client/pc/el/&#936;&nbsp;0.11&lt;client/pc/en/Psi&nbsp;0.11&lt;http://jabber.org/protocol/caps&lt;http://jabber.org/protocol/disco#info&lt;http://jabber.org/protocol/disco#items&lt;http://jabber.org/protocol/muc&lt;urn:xmpp:dataforms:softwareinfo&lt;ip_version&lt;ipv4&lt;ipv6&lt;os&lt;Mac&lt;os_version&lt;10.5.1&lt;software&lt;Psi&lt;software_version&lt;0.11&lt;'</li>
<li>ver = q07IKJEyjvHSyhy//CH0CxmKi8w=</li>
</ol>
</section2>
<section2 topic='Processing Method' anchor='ver-proc'>
@ -396,7 +395,7 @@
<c xmlns='http://jabber.org/protocol/caps'
hash='sha-1'
node='http://code.google.com/p/exodus'
ver='SrFo9ar2CCk2EnOH4q4QANeuxLQ='/>
ver='QgayPKawpkPSDYmwT/WM94uAlu0='/>
</presence>
]]></example>
<p>If the supported features change during a generating entity's presence session (e.g., a user installs an updated version of a client plugin), the application MUST recompute the verification string and SHOULD send a new presence broadcast.</p>
@ -419,13 +418,13 @@
to='romeo@montague.lit/orchard'
type='get'>
<query xmlns='http://jabber.org/protocol/disco#info'
node='http://code.google.com/p/exodus#SrFo9ar2CCk2EnOH4q4QANeuxLQ='/>
node='http://code.google.com/p/exodus#QgayPKawpkPSDYmwT/WM94uAlu0='/>
</iq>
]]></example>
<p>The disco#info request is sent by the requesting entity to the generating entity. The value of the 'to' attribute MUST be the exact JID of the generating entity, which in the case of a client will be the full JID &LOCALFULL;.</p>
<p>The disco 'node' attribute MUST be included for backwards-compatibility. The value of the 'node' attribute SHOULD be generated by concatenating the value of the caps 'node' attribute (e.g., "http://code.google.com/p/exodus") as provided by the generating entity, the "#" character, and the value of the caps 'ver' attribute (e.g., "SrFo9ar2CCk2EnOH4q4QANeuxLQ=") as provided by the generating entity.</p>
<p>The disco 'node' attribute MUST be included for backwards-compatibility. The value of the 'node' attribute SHOULD be generated by concatenating the value of the caps 'node' attribute (e.g., "http://code.google.com/p/exodus") as provided by the generating entity, the "#" character, and the value of the caps 'ver' attribute (e.g., "QgayPKawpkPSDYmwT/WM94uAlu0=") as provided by the generating entity.</p>
<p>The generating entity then returns all of the capabilities it supports.</p>
@ -435,7 +434,7 @@
to='juliet@capulet.lit/balcony'
type='result'>
<query xmlns='http://jabber.org/protocol/disco#info'/>
node='http://code.google.com/p/exodus#SrFo9ar2CCk2EnOH4q4QANeuxLQ='>
node='http://code.google.com/p/exodus#QgayPKawpkPSDYmwT/WM94uAlu0='>
<identity category='client' type='pc'/>
<feature var='http://jabber.org/protocol/disco#info'/>
<feature var='http://jabber.org/protocol/disco#items'/>