From c6b7d2c337bf947e8c3a6ff45b46ccbefa2cfea2 Mon Sep 17 00:00:00 2001 From: Peter Saint-Andre Date: Fri, 31 Aug 2007 14:39:55 +0000 Subject: [PATCH] 0.12 git-svn-id: file:///home/ksmith/gitmigration/svn/xmpp/trunk@1201 4b5297f7-1745-476d-ba37-a9c6900126ab --- xep-0084.xml | 186 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 121 insertions(+), 65 deletions(-) diff --git a/xep-0084.xml b/xep-0084.xml index 3512e285..514cfdaf 100644 --- a/xep-0084.xml +++ b/xep-0084.xml @@ -21,6 +21,7 @@ XEP-0008 + XEP-0153 TO BE ASSIGNED @@ -28,6 +29,12 @@ &pgmillard; &temas; &xvirge; + + 0.12 + 2007-08-31 + psa +

Clarified HTTP publishing; completed copy edit.

+
0.11 2007-07-25 @@ -100,6 +107,7 @@

The protocol defined herein uses two pubsub nodes: one node for "metadata" about the avatar state (called the "metadata node") and one for the avatar data itself (called the "data node"). This separation of metadata from data conserves bandwidth and enables both the publisher and the subscriber to cache the avatar data. (For example, a user might toggle between two or three avatars, in which case the user's contacts can display a locally cached version of the images without having to retrieve or receive the full image each time.)

This protocol also allows storage of avatar data at a URL accessible via HTTP (see &rfc2616;). By "accessible via HTTP" is meant that the data is available at an http: or https: URI. This can be helpful as a fallback mechanism if a pubsub-aware data repository is not available. It also makes it possible for avatar images to be hosted on public websites (e.g., an end-user-oriented community site) and retrieved from that site rather than handled directly by the publishing client in any fashion.

Finally, this protocol also enables XMPP applications to optionally integrate with third-party services that host user avatars (e.g., online gaming systems and virtual worlds).

+

It is intended that this specification will supersede both &xep0008; and &xep0153; once the PEP subset of XMPP publish-subscribe is implemented and deployed widely enough.

This document addresses the following use cases for avatar publishers:

@@ -119,16 +127,16 @@

The process for publishing and updating user avatars is as follows:

    -
  1. User publishes avatar data for "image/png" content-type to data node and optionally publishes other content-types to HTTP URLs
  2. -
  3. 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)
  4. -
  5. Subscribers receive notification
  6. -
  7. Optionally (and if necessary), subscribers retrieve avatar data identified by ItemID from data node using pubsub retrieve-items feature (or via HTTP)
  8. +
  9. User publishes avatar data for "image/png" content-type to data node and optionally publishes other content-types to HTTP URLs.
  10. +
  11. User publishes notification of updated avatar to metadata node, with ItemID that matches SHA-1 hash of image data for "image/png" content-type (note: this is a hash of the image data itself, not the base64-encoded version).
  12. +
  13. Subscribers receive notification.
  14. +
  15. Optionally (and if necessary), subscribers retrieve avatar data identified by ItemID from data node using pubsub retrieve-items feature (or via HTTP).
  16. Optionally, user disables avatar display.

This process flow is described more fully in the following sections.

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 XEP-0163, since such support simplifies avatar publication. The following examples assume the availability of a PEP service.

-

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).

+

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 a SHA-1 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).

The following example illustrates the XML structure to be sent when publishing avatar data to the data node.

@@ -146,20 +154,40 @@ ]]> +

If the avatar will be made available via HTTP instead of a pubsub data node, the publisher MUST either verify that the avatar exists at the HTTP URL or publish it via standard HTTP methods (such methods are out of scope for this specification; refer to RFC 2616).

Whenever the publisher wishes to change its current avatar, it MUST update the metadata node.

-

The following example shows metadata specifying avatar data that is available in only one format ("image/png") and accessible only at the data node:

+

The following example shows metadata specifying avatar data that is available in only one format ("image/png") and accessible only at the data node.

- + + + + + + ]]> +

The following example shows metadata specifying avatar data that is available at an HTTP URL.

+ + + + + + @@ -169,17 +197,17 @@ ]]>
-

Subscribers to the metadata node would then receive the notification:

+

The user's virtual pubsub service would then send the metadata notification to entities that have subscribed to the user's metadata node or contacts who have advertised an interest in receiving avatar metadata by including a &xep0115; feature of "http://www.xmpp.org/extensions/xep-0084.html#ns-metadata+notify" &NSNOTE;.

- @@ -190,11 +218,11 @@ ]]> -

Depending on node configuration, the item may include &xep0033; information about the publishing resource (see XEP-0163 and XEP-0060 for details).

+

As shown, depending on node configuration, the item may include &xep0033; information about the publishing resource (see XEP-0060 for details).

-

Upon receiving the notification, each subscriber SHOULD determine if it has a locally cached copy of that avatar (which it can determine by searching for an image identified by the ItemID). If the subscriber already has a locally cached copy of the avatar image, it MUST NOT retrieve the image data.

-

If the subscriber does not have a locally cached copy of the avatar image, it SHOULD retrieve the data. It can do this by sending a pubsub retrieve-items request to the data node, specifying the appropriate ItemID:

+

Upon receiving the notification, each subscriber SHOULD determine if it has a locally cached copy of that avatar (which it can do by searching for an image identified by the ItemID). If the subscriber already has a locally cached copy of the avatar image, it MUST NOT retrieve the image data.

+

If the subscriber does not have a locally cached copy of the avatar image, it SHOULD retrieve the data. It can do this by sending a pubsub retrieve-items request to the data node, specifying the appropriate ItemID.

]]> -

The PEP service running at the user's server then SHOULD return the avatar data:

+

The PEP service running at the user's server then SHOULD return the avatar data.

]]> -

If the <info/> element sent to the metadata node possesses a 'url' attribute, the avatar data is hosted at a URL. Therefore, in order to retrieve the avatar image data for that content-type, the requesting entity MUST send an HTTP request to the specified URL. Methods for doing so are out of scope for this document.

+

If the <info/> element sent to the metadata node possesses a 'url' attribute, the avatar data is hosted at a URL. Therefore, in order to retrieve the avatar image data for that content-type, the requesting entity MUST send an HTTP request to the specified URL. Methods for doing so are out of scope for this specification (see RFC 2616).

-

In order to temporarily disable any avatar, the user publishes an empty <stop/> element to the metadata node (this item SHOULD NOT possess an ItemID):

+

In order to temporarily disable any avatar, the user publishes an empty <stop/> element to the metadata node (this item SHOULD NOT possess an ItemID).

@@ -241,7 +269,7 @@ ]]> -

As before, subscribers to the metadata node would then receive the notification:

+

As before, subscribers to the metadata node would then receive the notification.

@@ -261,20 +289,21 @@
-

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:

+

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 &NSNOTE;:

  • <data xmlns='http://www.xmpp.org/extensions/xep-0084.html#ns-data'/>
  • <metadata xmlns='http://www.xmpp.org/extensions/xep-0084.html#ns-metadata'/>

These are further specified below.

-

The <data/> element is used to communicate the avatar data itself, and only for the "image/png" content-type (support for which is REQUIRED):

+

The <data/> element is used to communicate the avatar data itself, and only for the "image/png" content-type (support for which is REQUIRED).

IMAGE DATA ]]>

The XML character data MUST represent the image data for the avatar with a content-type of "image/png", Base64-encoded in accordance with Section 4 of &rfc4648;. (Note: Line feeds SHOULD NOT be added but MUST be accepted.)

+

The <data/> element MUST NOT possess any attributes.

Support for the <data/> element is REQUIRED.

@@ -286,40 +315,60 @@

These are further specified below.

-

The <info/> child element is used to communicate avatar metadata:

+

The <info/> child element is used to communicate avatar metadata. Support for the <info/> element is REQUIRED.

]]>

The <info/> child element MUST be empty.

-

The <info/> child element MUST possess the following attributes:

-
    -
  • bytes -- The size of the image data in bytes.
  • -
  • id -- The SHA1 hash of the image data for the specified content-type.
  • -
  • type -- The IANA-registered content type of the image data.
  • -
-

The <info/> child element SHOULD possess the following attributes:

-
    -
  • height -- The height of the image in pixels.
  • -
  • width -- The width of the image in pixels.
  • -
-

The <info/> element MAY possess the following attribute:

-
    -
  • url -- An http: or https: URI at which the image data file may be found.
  • -
-

If the <info/> element element does not possess a 'url' attribute, then it is assumed that the data is available at the data node rather than an HTTP URL.

+

The defined attributes of the <info/> element are specified in the following table.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDefinitionInclusion
bytesThe size of the image data in bytes.REQUIRED
heightThe height of the image in pixels.RECOMMENDED
idA hash of the image data for the specified content-type, where the hash is produced in accordance with the SHA-1 algorithm as specified in &rfc3174; (with binary output).REQUIRED
typeThe IANA-registered content type of the image data.REQUIRED
urlThe http: or https: URL at which the image data file is hosted; this attribute MUST NOT be included unless the image data file can be retrieved via HTTP.OPTIONAL
widthThe width of the image in pixelsRECOMMENDED

The <metadata/> root element MAY contain more than one <info/> element. Each <info/> element MUST specify metadata for the same avatar image but in alternate content-types (e.g., "image/png", "image/gif", and "image/jpeg"), and one of the formats MUST be "image/png" to ensure interoperability. The value of the 'type' attribute MUST be an IANA-registered content type of type "image" or "video". The IANA registry of content types is located at <http://www.iana.org/assignments/media-types/>. Support for the "image/png" content type is REQUIRED. Support for the "image/gif" and "image/jpeg" content types is RECOMMENDED. Support for any other content type is OPTIONAL.

-

The value of the 'id' attribute MUST be the SHA1 (&rfc3174;) hash of the image data for the specified content-type.

-

Support for the <info/> element is REQUIRED.

-

The <pointer/> 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:

+

The <pointer/> 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.

@@ -331,7 +380,7 @@
  • bytes -- The size of the image data in bytes.
  • height -- The height of the image in pixels.
  • -
  • id -- The SHA1 hash of the image data for the specified content-type.
  • +
  • id -- The SHA-1 hash of the image data for the specified content-type.
  • type -- The IANA-registered content type of the image data.
  • width -- The width of the image in pixels.
@@ -340,7 +389,7 @@

Support for the <pointer/> element is OPTIONAL.

-

The <stop/> child element is used to signal that avatar publishing has been disabled:

+

The <stop/> child element is used to signal that avatar publishing has been disabled.

@@ -353,29 +402,35 @@
-

The following example shows metadata specifying avatar data that is available in multiple formats ("image/png", "image/gif", and "image/mng"), where the "image/png" content-type is available only at the data node and the other content-types are available HTTP URLs:

+

The following example shows metadata specifying avatar data that is available in multiple formats ("image/png", "image/gif", and "image/mng"), where the "image/png" content-type is available only at the data node and the other content-types are available HTTP URLs.

- - + - @@ -383,6 +438,7 @@ ]]> +

In the foregoing example, the image encapsulated in the "image/png" content type is available both at a pubsub data node and at an HTTP URL; therefore it is included twice (the second time with a 'url' attribute).

The following example shows metadata specifying avatar data that is available in "image/png" at the data node and also with a pointer to an external service.

@@ -392,10 +448,10 @@ - @@ -413,7 +469,7 @@
-

The pubsub "auto-subscribe" and "filtered-notifications" features enable a contact to automatically subscribe to a user's avatar. However, a contact can also explicitly determine if another user publishes avatars using this protocol by sending a &xep0030; items ("disco#items") request to the user's bare JID (&BAREJID;):

+

The pubsub "auto-subscribe" and "filtered-notifications" features enable a contact to automatically subscribe to a user's avatar. However, a contact can also explicitly determine if another user publishes avatars using this protocol by sending a &xep0030; items ("disco#items") request to the user's bare JID (&BAREJID;).

]]> -

If the user publishes avatar data to an PEP node, the result MUST contain the appropriate items:

+

If the user publishes avatar data to an PEP node, the result MUST contain the appropriate items.

-

If a user has multiple online resources at the same time, each resource MAY publish a different avatar. The PEP service SHOULD include the replyto address of the publishing resource as shown above in order to facilitate differentiation between per-resource avatars.

+

If a user has multiple online resources at the same time, each resource MAY publish a different avatar. The PEP service SHOULD include the "replyto" address of the publishing resource as shown above in order to facilitate differentiation between per-resource avatars.

-

When a user logs in with a new resource and before publishing an avatar, its client SHOULD retrieve its last published avatar, either automatically by sending presence with the appropriate &xep0115; information or using the "retrieve-items" method described in XEP-0060.

+

When a user logs in with a new resource and before publishing an avatar, its client SHOULD retrieve its last published avatar, either automatically by sending presence with the appropriate entity capabilities information (see XEP-0115) or using the "retrieve-items" method described in XEP-0060.

It is the responsibility of the receiving application to determine which avatar format to retrieve (e.g., "image/gif" rather than "image/png") and to determine the appropriate method for retrieval (e.g., HTTP rather than pubsub).

The receiving application SHOULD NOT scale up an image when displaying it.

-

If an avatar is not available for a contact, the receiving MAY display the contact's photo, e.g., as provided in the contact's vCard (see &xep0054;) or other profile information.

+

If an avatar is not available for a contact, the receiving application MAY display the contact's photo, e.g., as provided in the contact's vCard (see &xep0054;) or other profile information.