git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@490 4b5297f7-1745-476d-ba37-a9c6900126ab
This commit is contained in:
Peter Saint-Andre 2007-02-02 03:40:00 +00:00
parent a077efa2d7
commit 80189d08dc
1 changed files with 36 additions and 77 deletions

View File

@ -10,7 +10,7 @@
<abstract>This document defines an XMPP protocol extension for exchanging user avatars.</abstract>
&LEGALNOTICE;
<number>0084</number>
<status>Deferred</status>
<status>Experimental</status>
<type>Standards Track</type>
<sig>Standards</sig>
<dependencies>
@ -23,16 +23,16 @@
<spec>XEP-0008</spec>
</supersedes>
<supersededby/>
<shortname>avatar</shortname>
<shortname>TO BE ASSIGNED</shortname>
&stpeter;
&pgmillard;
&temas;
&xvirge;
<revision>
<version>0.9</version>
<date>2007-01-04</date>
<date>2007-02-01</date>
<initials>psa</initials>
<remark><p>Updated to reflect pubsub and PEP changes; added implementation notes about multiple resources and avatar synchronization.</p></remark>
<remark><p>Updated to reflect pubsub and PEP changes; added implementation notes about multiple resources and avatar synchronization; modified experimental namespaces to conform to XEP-0053.</p></remark>
</revision>
<revision>
<version>0.8</version>
@ -107,8 +107,6 @@
<section1 topic='Basic Process Flow' anchor='process'>
<p>The process for publishing and updating user avatars is as follows:</p>
<ol>
<li>User creates metadata node</li>
<li>User creates data node for "image/png" content-type</li>
<li>User publishes avatar data for "image/png" content-type to data node and optionally publishes other content-types to HTTP URLs</li>
<li>User publishes notification of updated avatar to metadata node, with ItemID that matches SHA1 hash of image data for "image/png" content-type (note: this is a hash of the image data itself, not the base64-encoded version)</li>
<li>Subscribers receive notification</li>
@ -116,55 +114,16 @@
<li>Optionally, user disables avatar display.</li>
</ol>
<p>This process flow is described more fully in the following sections.</p>
<p>Note: Before publishing avatar data and metadata, the user MUST determine if his or her server supports the PEP subset of pubsub by following the procedures specified in <cite>XEP-0163</cite>.</p>
<section2 topic='User Creates Metadata Node' anchor='process-createmeta'>
<p>In order to publish notifications related to its avatar, the user MUST first create a node for his or her avatar metadata:</p>
<example caption='Pubsub metadata node creation request'><![CDATA[
<iq type='set' from='juliet@capulet.com/chamber' id='create1'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<create node='http://jabber.org/protocol/avatar#metadata'/>
<configure>
<x xmlns='jabber:x:data' type='form'>
<field var='FORM_TYPE' type='hidden'>
<value>http://jabber.org/protocol/pubsub#node_config</value>
</field>
<field var='pubsub#access_model'>
<option><value>presence</value></option>
</field>
</x>
</configure>
</pubsub>
</iq>
]]></example>
<p>The NodeID MUST be "http://jabber.org/protocol/avatar#metadata" and the access model SHOULD be "presence". Note: If the default access model (see <cite>XEP-0163</cite>) is the same as the desired access model, the user can send an empty &lt;configure/&gt; element rather than including a data form as shown above.</p>
<example caption='Pubsub service replies with success'><![CDATA[
<iq type='result' to='juliet@capulet.com/chamber' id='create1'/>
]]></example>
</section2>
<section2 topic='User Creates Data Node' anchor='process-createdata'>
<p>Next, the user SHOULD create a node for his or her avatar data (however, note that data publication via XMPP is not required since the data could be made available at an HTTP URL):</p>
<example caption='Pubsub data node creation request'><![CDATA[
<iq type='set' from='juliet@capulet.com/chamber' id='create2'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<create node='http://jabber.org/protocol/avatar#data'/>
<configure/>
</pubsub>
</iq>
]]></example>
<p>If the user creates a data note, the NodeID MUST be "http://jabber.org/protocol/avatar#data" and the access model SHOULD be "presence".</p>
<example caption='Pubsub service replies with success'><![CDATA[
<iq type='result' to='juliet@capulet.com/chamber' id='create2'/>
]]></example>
</section2>
<p>Note: Before publishing avatar data and metadata, the user MUST determine if his or her server supports the PEP subset of pubsub by following the procedures specified in <cite>XEP-0163</cite>, since such support simplifies avatar publication. The following examples assume the availability of a PEP service.</p>
<section2 topic='User Publishes Data' anchor='process-pubdata'>
<p>Before updating the avatar metadata node, the publisher MUST make sure that the avatar data is available at the data node or URL. When publishing the avatar data to the data node, the publisher MUST ensure that the value of the pubsub ItemID is the SHA1 hash of the data for the "image/png" content-type (this is used by the subscriber to determine if a locally cached copy can be displayed).</p>
<p>The following example illustrates the XML structure to be sent when publishing avatar data to the data node.</p>
<example caption='Publishing avatar data to data node'><![CDATA[
<iq type='set' from='juliet@capulet.com/chamber' id='publish1'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='http://jabber.org/protocol/avatar#data'>
<publish node='http://www.xmpp.org/extensions/xep-0084.html#ns-data'>
<item id='111f4b3c50d7b0df729d299bc6f8e9ef9066971f'>
<data xmlns='http://jabber.org/protocol/avatar#data'>
<data xmlns='http://www.xmpp.org/extensions/xep-0084.html#ns-data'>
qANQR1DBwU4DX7jmYZnncm...
</data>
</item>
@ -182,9 +141,9 @@
<example caption='Publishing avatar metadata'><![CDATA[
<iq type='set' from='juliet@capulet.com/chamber' id='publish2'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='http://jabber.org/protocol/avatar#metadata'>
<publish node='http://www.xmpp.org/extensions/xep-0084.html#ns-metadata'>
<item id='111f4b3c50d7b0df729d299bc6f8e9ef9066971f'>
<metadata xmlns='http://jabber.org/protocol/avatar#metadata'>
<metadata xmlns='http://www.xmpp.org/extensions/xep-0084.html#ns-metadata'>
<info id='111f4b3c50d7b0df729d299bc6f8e9ef9066971f'
type='image/png'
bytes='12345'
@ -202,9 +161,9 @@
<example caption='Subscribers receive avatar metadata notification'><![CDATA[
<message to='romeo@montague.net' from='juliet@capulet.com'>
<event xmlns='http://jabber.org/protocol/pubsub#event'>
<items node='http://jabber.org/protocol/avatar#metadata'>
<items node='http://www.xmpp.org/extensions/xep-0084.html#ns-metadata'>
<item id='111f4b3c50d7b0df729d299bc6f8e9ef9066971f'>
<metadata xmlns='http://jabber.org/protocol/avatar#metadata'>
<metadata xmlns='http://www.xmpp.org/extensions/xep-0084.html#ns-metadata'>
<info id='111f4b3c50d7b0df729d299bc6f8e9ef9066971f'
type='image/png'
bytes='12345'
@ -230,7 +189,7 @@
to='juliet@capulet.com'
id='retrieve1'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<items node='http://jabber.org/protocol/avatar#data'>
<items node='http://www.xmpp.org/extensions/xep-0084.html#ns-data'>
<item id='111f4b3c50d7b0df729d299bc6f8e9ef9066971f'>
</items>
</pubsub>
@ -240,9 +199,9 @@
<example caption='Publishing avatar data to data node'><![CDATA[
<iq type='result' from='juliet@capulet.com' to='romeo@montague.net/home' id='publish1'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='http://jabber.org/protocol/avatar#data'>
<publish node='http://www.xmpp.org/extensions/xep-0084.html#ns-data'>
<item id='111f4b3c50d7b0df729d299bc6f8e9ef9066971f'>
<data xmlns='http://jabber.org/protocol/avatar#data'>
<data xmlns='http://www.xmpp.org/extensions/xep-0084.html#ns-data'>
qANQR1DBwU4DX7jmYZnncm...
</data>
</item>
@ -259,7 +218,7 @@
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='avatar/info/juliet@capulet.com'>
<item>
<metadata xmlns='http://jabber.org/protocol/avatar#metadata'>
<metadata xmlns='http://www.xmpp.org/extensions/xep-0084.html#ns-metadata'>
<stop/>
</metadata>
</item>
@ -271,9 +230,9 @@
<example caption='Subscribers receive avatar metadata notification'><![CDATA[
<message to='romeo@montague.net' from='juliet@capulet.com'>
<event xmlns='http://jabber.org/protocol/pubsub#event'>
<items node='http://jabber.org/protocol/avatar#metadata'>
<items node='http://www.xmpp.org/extensions/xep-0084.html#ns-metadata'>
<item>
<metadata xmlns='http://jabber.org/protocol/avatar#metadata'>
<metadata xmlns='http://www.xmpp.org/extensions/xep-0084.html#ns-metadata'>
<stop/>
</metadata>
</item>
@ -289,14 +248,14 @@
<section1 topic='Protocol Syntax' anchor='proto'>
<p>The PEP subset of pubsub requires that there shall exist a one-to-one relationship between namespaces and nodes. Because the protocol defined herein stipulates the use of two nodes (one for avatar data and one for avatar metadata), we define two namespaces, each with a corresponding root element:</p>
<ul>
<li>&lt;data xmlns='http://jabber.org/protocol/avatar#data'/&gt;</li>
<li>&lt;metadata xmlns='http://jabber.org/protocol/avatar#metadata'/&gt;</li>
<li>&lt;data xmlns='http://www.xmpp.org/extensions/xep-0084.html#ns-data'/&gt;</li>
<li>&lt;metadata xmlns='http://www.xmpp.org/extensions/xep-0084.html#ns-metadata'/&gt;</li>
</ul>
<p>These are further specified below.</p>
<section2 topic='Data Element' anchor='proto-data'>
<p>The &lt;data/&gt; element is used to communicate the avatar data itself, and only for the "image/png" content-type (support for which is REQUIRED):</p>
<code><![CDATA[
<data xmlns='http://jabber.org/protocol/avatar#data'>
<data xmlns='http://www.xmpp.org/extensions/xep-0084.html#ns-data'>
IMAGE DATA
</data>
]]></code>
@ -314,7 +273,7 @@
<section3 topic='Info Element' anchor='proto-info'>
<p>The &lt;info/&gt; child element is used to communicate avatar metadata:</p>
<code><![CDATA[
<metadata xmlns='http://jabber.org/protocol/avatar#metadata'>
<metadata xmlns='http://www.xmpp.org/extensions/xep-0084.html#ns-metadata'>
<info id='SHA1-hash-of-image-data'
url='HTTP-URL-for-image-data'
type='content-type-of-image-data'
@ -344,11 +303,11 @@
<section3 topic='Pointer Element' anchor='proto-pointer'>
<p>The &lt;pointer/&gt; child element is used to point to an avatar that is not published via pubsub or HTTP, but rather is provided by a third-party service such as an online gaming system or virtual world:</p>
<code><![CDATA[
<avatar xmlns='http://jabber.org/protocol/avatar'>
<metadata xmlns='http://www.xmpp.org/extensions/xep-0084.html#ns-metadata'>
<pointer>
... APPLICATION-SPECIFIC DATA ...
</pointer>
</avatar>
</metadata>
]]></code>
<p>The &lt;pointer/&gt; element MAY possess the following attributes if the publishing application has the relevant information:</p>
<ul>
@ -365,7 +324,7 @@
<section3 topic='Stop Element' anchor='proto-stop'>
<p>The &lt;stop/&gt; child element is used to signal that avatar publishing has been disabled:</p>
<code><![CDATA[
<metadata xmlns='http://jabber.org/protocol/avatar#metadata'>
<metadata xmlns='http://www.xmpp.org/extensions/xep-0084.html#ns-metadata'>
<stop/>
</metadata>
]]></code>
@ -380,9 +339,9 @@
<example caption='Publishing avatar metadata (multiple formats)'><![CDATA[
<iq type='set' from='juliet@capulet.com/chamber' id='publish3'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='http://jabber.org/protocol/avatar#metadata'>
<publish node='http://www.xmpp.org/extensions/xep-0084.html#ns-metadata'>
<item id='111f4b3c50d7b0df729d299bc6f8e9ef9066971f'>
<metadata xmlns='http://jabber.org/protocol/avatar#metadata'>
<metadata xmlns='http://www.xmpp.org/extensions/xep-0084.html#ns-metadata'>
<info id='111f4b3c50d7b0df729d299bc6f8e9ef9066971f'
type='image/png'
bytes='12345'
@ -412,9 +371,9 @@
<example caption='Publishing avatar metadata (with pointer)'><![CDATA[
<iq type='set' from='juliet@capulet.com/chamber' id='publish4'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='http://jabber.org/protocol/avatar#metadata'>
<publish node='http://www.xmpp.org/extensions/xep-0084.html#ns-metadata'>
<item id='111f4b3c50d7b0df729d299bc6f8e9ef9066971f'>
<metadata xmlns='http://jabber.org/protocol/avatar#metadata'>
<metadata xmlns='http://www.xmpp.org/extensions/xep-0084.html#ns-metadata'>
<info id='111f4b3c50d7b0df729d299bc6f8e9ef9066971f'
type='image/png'
bytes='12345'
@ -452,8 +411,8 @@
to='romeo@montague.net/orchard'
id='items1'>
<query xmlns='http://jabber.org/protocol/disco#items'>
<item jid='juliet@capulet.com' node='http://jabber.org/protocol/avatar#data'/>
<item jid='juliet@capulet.com' node='http://jabber.org/protocol/avatar#metadata'/>
<item jid='juliet@capulet.com' node='http://www.xmpp.org/extensions/xep-0084.html#ns-data'/>
<item jid='juliet@capulet.com' node='http://www.xmpp.org/extensions/xep-0084.html#ns-metadata'/>
</query>
</iq>
]]></example>
@ -485,8 +444,8 @@
<p>This document makes use of IANA-registered content types, but requires no interaction with &IANA;.</p>
</section1>
<section1 topic='XMPP Registrar Considerations' anchor='registrar'>
<section2 topic='Protocol Namespaces' anchor='registrar-ns'>
<p>The &REGISTRAR; shall include 'http://jabber.org/protocol/avatar#data' and 'http://jabber.org/protocol/avatar#metadata' in its registry of protocol namespaces.</p>
<section2 topic='Protocol Namespaces' anchor='ns'>
<p>Until this specification advances to a status of Draft, its associated namespaces shall be "http://www.xmpp.org/extensions/xep-0084.html#ns-data" and "http://www.xmpp.org/extensions/xep-0084.html#ns-metadata"; upon advancement of this specification, the &REGISTRAR; shall issue permanent namespaces in accordance with the process defined in Section 4 of &xep0053;.</p>
</section2>
</section1>
<section1 topic='XML Schema' anchor='schema'>
@ -496,8 +455,8 @@
<xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='http://jabber.org/protocol/avatar#metadata'
xmlns='http://jabber.org/protocol/avatar#metadata'
targetNamespace='http://www.xmpp.org/extensions/xep-0084.html#ns-metadata'
xmlns='http://www.xmpp.org/extensions/xep-0084.html#ns-metadata'
elementFormDefault='qualified'>
<xs:element name='data' type='xs:base64Binary'>
@ -511,8 +470,8 @@
<xs:schema
xmlns:xs='http://www.w3.org/2001/XMLSchema'
targetNamespace='http://jabber.org/protocol/avatar#metadata'
xmlns='http://jabber.org/protocol/avatar#metadata'
targetNamespace='http://www.xmpp.org/extensions/xep-0084.html#ns-metadata'
xmlns='http://www.xmpp.org/extensions/xep-0084.html#ns-metadata'
elementFormDefault='qualified'>
<xs:element name='metadata'>