diff --git a/inbox/muc-avatars.xml b/inbox/muc-avatars.xml index 967cd3f5..b69c0751 100644 --- a/inbox/muc-avatars.xml +++ b/inbox/muc-avatars.xml @@ -6,8 +6,8 @@
- MUC Avatars - This specification describes how to publish and retrieve avatars in rooms. + XMPP Resources Avatars + This specification describes how to publish and retrieve avatars from XMPP resources. &LEGALNOTICE; xxxx ProtoXEP @@ -31,6 +31,12 @@ linkmauve@linkmauve.fr linkmauve@linkmauve.fr + + Timothée + Jaussoin + edhelas@movim.eu + edhelas@movim.eu + 0.0.1 2018-08-21 @@ -39,7 +45,7 @@
-

Avatars are small images people often use to identify each other very quickly in chat applications. They are well defined for users, in &xep0084; and &xep0153;, but until now chat rooms all shared a default icon. This extension provides a way for owners to associates an avatar to their chat room, and for users to discover that an avatar is associated and display it accordingly.

+

Avatars are small images people often use to identify each other very quickly in chat applications. They are well defined for users, in &xep0084; and &xep0153;, but until now chat rooms and Pubsub nodes all shared a default icon. This extension provides a way for owners to associates an avatar to the XMPP their resources and users to discover that an avatar is associated and display it accordingly.

XMPP services have traditionally allowed owners to set a vCard-temp on a MUC using &xep0054;, this extension tries to keep as much of it as possible so existing applications don’t have to be modified too much.

Some implementations recently chose to advertise those avatars using the existing &xep0153; extension in <presence/>, but it exposed issues in other implementations, and was only available when the user is already present in the room, not before joining it (for example when listing all available rooms).

A future extension superseding this one could define a method based on &xep0084;, with a PubSub service on the room’s bare JID containing the metadata and data nodes. Such a specification should also define a compatibility profile similar to &xep0398; for user avatars, enabling the coexistence of both versions until the present one is deemed obsolete.

@@ -47,18 +53,20 @@

This specification SHOULD:

    -
  • Allow authorised entities to set an avatar on a MUC.
  • -
  • Allow authorised entities to remove a previously-set avatar on a MUC.
  • -
  • Allow users to discover an avatar is set on a MUC.
  • -
  • Allow users to request the avatar of a MUC.
  • +
  • Allow authorised entities to set an avatar on a MUC, user JID or Pubsub node.
  • +
  • Allow authorised entities to remove a previously-set avatar on a MUC, user JID or Pubsub node.
  • +
  • Allow users to discover an avatar is set on a MUC, user JID or Pubsub node.
  • +
  • Allow users to request the avatar of a MUC, user JID or Pubsub node.
  • Let users know that the avatar of a MUC changed while they are present in said MUC.
  • -
  • Let users discover the avatar even when not present in the MUC.
  • -
  • Stay as compatible as possible with the current usage of avatars in MUC.
  • +
  • Let users know that the avatar of a Pubsub node changed while they are subscribed to this node.
  • +
  • Let users know that the avatar of a user JID changed while they are subscribed to this user.
  • +
  • Let users discover the avatar even when not present in the MUC, user JID or Pubsub node.
  • +
  • Stay as compatible as possible with the current usage of avatars in MUC and user JID.
-

Before trying to use avatars, a client must check that the group chat service hosting a room does support them.

+

Before trying to use avatars, a client must check that the related service that is hosting the rooms or Pubsub nodes does support them.

]]> + + + +]]> + + + + + + ... + +]]>
- -

Before anyone can see an avatar attached to the room, an owner or some other priviledged entity must publish a vCard-temp containing the avatar’s data, using the protocol defined in &xep0054;.

+ +

Before anyone can see an avatar attached to the resource, an owner or some other priviledged entity must publish a vCard-temp containing the avatar’s data, using the protocol defined in &xep0054;.

]]> + + + + + + image/svg+xml + PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiI+CiA8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9InJlZCIvPgo8L3N2Zz4K + + + +]]> + ]]> +

There is no other action required on the owner’s end.

-

If the room doesn’t support support avatars, it must return a service-unavailable error.

+

If the service doesn’t support support avatars, it must return a service-unavailable error.

]]> -

If the user trying to publish an avatar isn’t allowed to do so, the room must return a forbidden error, see the Security Considerations.

+

If the user trying to publish an avatar isn’t allowed to do so, the resource must return a forbidden error, see the Security Considerations.

Only owners are allowed to set avatars. ]]> -

The room should then broadcast a notification that the configuration changed to all users present.

+

The resource should then broadcast a notification that the configuration changed to all users present or subscribed.

]]> + +

For Pubsub nodes, the service broadcast a configuration change to all the subscribed users as described in the section 8.2.5.3 of &xep0060;.

+ + + + + +]]> +

Setting an empty vCard unpublishes the avatar.

]]>
-

At any point, whether it is during a join in order to display it in its UI, after having discovered the list of the rooms and to list them with additional information, or when receiving a <status code='104'/> configuration change notification, a user’s client can discover information about a room.

+

At any point, whether it is during a join in order to display it in its UI, after having discovered the list of the rooms or Pubsub nodes and to list them with additional information, or when receiving a configuration change notification, a user’s client can discover information about a resource.

]]> -

If the room has had an avatar published, it should advertise it in its 'muc#roominfo' extension form, using the &xep0153; hash computation method.

+

If the resource has had an avatar published, it should advertise it in its 'muc#roominfo' or 'pubsub#meta-data' (see the section 5.4 of &xep0060;) extension form, using the &xep0153; hash computation method.

]]> -

This 'muc#roominfo_avatarhash' will not be present when the room doesn’t have an avatar set.

+ + + + + + + + http://jabber.org/protocol/pubsub#meta-data + + ... + + a31c4bd04de69663cfd7f424a8453f4674da37ff + + ... + + +]]> +

This 'muc#roominfo_avatarhash' or 'pubsubmuc#meta-data_avatarhash' are not present when the resource doesn’t have an avatar set.

-

At this point the client knows the hash and can retrieve the room’s vCard-temp.

- At this point the client knows the hash and can retrieve the resource's vCard-temp.

+ ]]> -

The client then has to decode the <BINVAL/> content from base64, hash it with sha1 and compare it with the advertised hash, and if it matches uses it as the room avatar under the <TYPE/> media type.

+

To retrieve the vCard-temp of a Pubsub node the client is then doing a specific request on the Node metadata (see the section 5.4 of &xep0060;).

+ + + + + +]]> + + + + + image/svg+xml + PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiI+CiA8cmVjdCB4PSIwIiB5PSIwIiB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9InJlZCIvPgo8L3N2Zz4K + + + +]]> + +

The client then has to decode the <BINVAL/> content from base64, hash it with sha1 and compare it with the advertised hash, and if it matches uses it as the resource avatar under the <TYPE/> media type.

An application MUST support the image/png media type, SHOULD support image/jpeg, image/gif and image/svg+xml, and MAY support additional formats.

-

A room SHOULD NOT include a 'muc#roominfo_avatarhash' field if it doesn’t have an avatar set.

+

A room or a Pubsub node SHOULD NOT include a 'muc#roominfo_avatarhash' or 'pubsubmuc#meta-data_avatarhash' field if it doesn’t have an avatar set.

-

Multiple <PHOTO/> elements may be present in a vCard, in which case they should all represent the same image and the 'muc#roominfo_avatarhash' field must contain a hash of all of them.

+

Multiple <PHOTO/> elements may be present in a vCard, in which case they should all represent the same image and the hash field must contain a hash of all of them.

]]>
-

Some existing implementations send or expect a presence from the room’s bare JID in order to detect an avatar being published. This had several issues, with existing clients handling that as a presence from a user with an empty nick or downright triggering an error, and was only available if the client was already present in the room, preventing any usecase where it would get displayed before entering the room.

+

Some existing implementations send or expect a presence from the room’s bare JID in order to detect an avatar being published. This had several issues, with existing clients handling that as a presence from a user with an empty nick or downright triggering an error, and was only available if the client was already present in the room, preventing any usecase where it would get displayed before entering the room.

For those reasons, this XEP doesn’t encourage this way of advertising the presence of an avatar, but for reference it would look like a &xep0153; presence payload:

@@ -296,6 +410,19 @@ type='text-multi' label='Hash of the vCard-temp avatar of this room'/> +]]> + + + + http://jabber.org/protocol/pubsub#meta-data + XEP-XXXX + Form extension for avatar support in a Pubsub node. + + ]]>