Avatars are small images people often use to identify each other very quickly in chat applications. They are well defined for users, in User Avatar (XEP-0084) [1] and vCard-Based Avatars (XEP-0153) [2], 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.
XMPP services have traditionally allowed owners to set a vCard-temp on a MUC using vcard-temp (XEP-0054) [3], 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 vCard-Based Avatars (XEP-0153) [2] 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 User Avatar (XEP-0084) [1], 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 User Avatar to vCard-Based Avatars Conversion (XEP-0398) [4] for user avatars, enabling the coexistence of both versions until the present one is deemed obsolete.
This specification SHOULD:
Before trying to use avatars, a client must check that the group chat service hosting a room 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 vcard-temp (XEP-0054) [3].
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 user trying to publish an avatar isn’t allowed to do so, the room must return a forbidden error, see the Security Considerations.
The room should then broadcast a notification that the configuration changed to all users present.
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.
If the room has had an avatar published, it should advertise it in its 'muc#roominfo' extension form, using the vCard-Based Avatars (XEP-0153) [2] hash computation method.
This 'muc#roominfo_avatarhash' will not be present when the room doesn’t have an avatar set.
At this point the client knows the hash and can retrieve the room’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.
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.
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.
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 vCard-Based Avatars (XEP-0153) [2] presence payload:
A server should take care that only allowed entities can publish a vCard-temp on a MUC, for instance room owners or service administrators.
This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [5].
The registrar shall add the following field to the 'muc#roominfo' data form:
Thanks to the Ejabberd developers for their MUC vCard tutorial, and to Sam Whited and Matthew Wild for their feedback.
This document in other formats: XML PDF
This XMPP Extension Protocol is copyright © 1999 – 2024 by the XMPP Standards Foundation (XSF).
Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.
## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##
In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.
This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at <https://xmpp.org/about/xsf/ipr-policy> or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).
The HTML representation (you are looking at) is maintained by the XSF. It is based on the YAML CSS Framework, which is licensed under the terms of the CC-BY-SA 2.0 license.
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.
The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.
Discussion on other xmpp.org discussion lists might also be appropriate; see <https://xmpp.org/community/> for a complete list.
Errata can be sent to <editor@xmpp.org>.
The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".
1. XEP-0084: User Avatar <https://xmpp.org/extensions/xep-0084.html>.
2. XEP-0153: vCard-Based Avatars <https://xmpp.org/extensions/xep-0153.html>.
3. XEP-0054: vcard-temp <https://xmpp.org/extensions/xep-0054.html>.
4. XEP-0398: User Avatar to vCard-Based Avatars Conversion <https://xmpp.org/extensions/xep-0398.html>.
5. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.
Note: Older versions of this specification might be available at https://xmpp.org/extensions/attic/
Restore to the first revision, and republish to the Historical track.
Generalise to non-MUC resources.
First draft.
@report{peyrot2018xep0486, title = {MUC Avatars}, author = {Peyrot, Emmanuel Gil}, type = {XEP}, number = {0486}, version = {0.1.0}, institution = {XMPP Standards Foundation}, url = {https://xmpp.org/extensions/xep-0486.html}, date = {2018-08-21/2024-03-10}, }
END