This document specifies a protocol for the storage of metacontacts associated with a Jabber/XMPP account.
WARNING: This document has not yet been accepted for consideration or approved in any official manner by the Jabber Software Foundation, and this document must not be referred to as a Jabber Enhancement Proposal (JEP). If this document is accepted as a JEP by the Jabber Council, it will be published at <http://www.jabber.org/jeps/> and announced on the <firstname.lastname@example.org> mailing list.
Last Updated: 2006-02-11
JIG: Standards JIG
Approving Body: Jabber Council
Dependencies: XMPP Core, JEP-0049
Superseded By: None
Short Name: Not yet assigned
This Jabber Enhancement Proposal is copyright 1999 - 2006 by the Jabber Software Foundation (JSF) and is in full conformance with the JSF's Intellectual Property Rights Policy <http://www.jabber.org/jsf/ipr-policy.shtml>. This material may be distributed only subject to the terms and conditions set forth in the Creative Commons Attribution License (<http://creativecommons.org/licenses/by/2.5/>).
The preferred venue for discussion of this document is the Standards-JIG discussion list: <http://mail.jabber.org/mailman/listinfo/standards-jig>.
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 3920) and XMPP IM (RFC 3921) specifications contributed by the Jabber Software 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 JEP 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 keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
Sometimes, the same contact can be more than once in the roster and this just takes space. This can be the case if the user uses multiple accounts and/or has the same contact in the roster as Jabber contact and/or as other IM networks via transports. Metacontacts is a way to hide children contacts under a parent contact. Some Jabber client already implement this feature; this JEP defines a way to store thiat information on the user's Jabber server.
Private XML Storage  provides with a convenient method for storing user data on the server using jabber:iq:private; all we need to do is define a namespace and schema for storing this sort of information. To this end, we introduce the 'storage' element, and the 'storage:metacontacts' to handle this data.
A storage element marked by the storage:contacts namespace will contain a collection of child elements, each representing a parent metacontact with his children contacts to be displayed in the client. Only one sub-element is defined: 'parent'.
All 'parent' elements under storage MUST have a 'jid' attribute, which is the jid of the parent contact.
The parent element SHOULD contain one or more 'child' sub-element. These child elements MUST have a 'jid' attribute, which is the jid of the sub-contact. They can also have an OPTIONAL 'account' attribute that defines the account to which jid belongs (this is useful for multi-account-capable clients that also support account merging). This account attribute SHOULD be taken into account by the client only if it supports account merging and this feature is active. If no account attribute is given, the client MUST consider that child contact is in the same account as parent contact.
<iq type='result' id='1'> <query xmlns='jabber:iq:private'> <storage xmlns='storage:metacontacts'> <parent email@example.com'> <child firstname.lastname@example.org'/> <child email@example.com' firstname.lastname@example.org'/> </parent> </storage> </query> </iq>
The "email@example.com" address from the same account and the "firstname.lastname@example.org" address from the "email@example.com" account SHOULD be displayed under the "firstname.lastname@example.org" contact.
Security considerations related to private XML storage are described in JEP-0049.
This JEP requires no interaction with the Internet Assigned Numbers Authority (IANA) .
No namespaces or parameters need to be registered with the Jabber Registrar  as a result of this JEP.
<?xml version='1.0' encoding='UTF-8'?> <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' targetNamespace='storage:metacontacts' xmlns='storage:metacontacts' elementFormDefault='qualified'> <xs:element name='storage'> <xs:complexType> <xs:choice> <xs:element ref='parent'/> </xs:choice> </xs:complexType> </xs:element> <xs:element name='parent'> <xs:complexType> <xs:sequence> <xs:element name='child' minOccurs='0'> <xs:attribute name='jid' type='xs:string' use='required'/> <xs:attribute name='account' type='xs:string' use='optional'/> </xs:element> </xs:sequence> <xs:attribute name='jid' type='xs:string' use='required'/> </xs:complexType> </xs:element> </xs:schema>
2. 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/>.
3. The Jabber Registrar maintains a list of reserved Jabber protocol namespaces as well as registries of parameters used in the context of protocols approved by the Jabber Software Foundation. For further information, see <http://www.jabber.org/registrar/>.