This document specifies best practices for roster and subscription management in Jabber/XMPP clients.
WARNING: This Informational JEP is Experimental. Publication as a Jabber Enhancement Proposal does not imply approval of this proposal by the Jabber Software Foundation. Implementation of the best practice or protocol profile described herein is encouraged in exploratory implementations, although production systems should not deploy implementations of this protocol until it advances to a status of Draft.
Last Updated: 2005-10-19
JIG: Standards JIG
Approving Body: Jabber Council
Superseded By: None
Short Name: N/A
Wiki Page: <http://wiki.jabber.org/index.php/Best Practices for Roster and Subscription Management (JEP-0162)>
This Jabber Enhancement Proposal is copyright 1999 - 2005 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.
RFC 3921  explains how subscriptions and rosters integrate. However, several points are left to the client author's discretion, and this can lead to some confusion among client developers. This JEP specifies best practices that enable all Jabber clients to manage subscriptions and roster in a coherent way, thus making sure that such clients will not surprise end users with unexpected behavior.
As defined in RFC 3921 (sections 6, 7, 8), a roster item can have one of the following subscription states:
Additionally, if subscription='from' or subscription='none', you can have ask='suscribe', which means you sent a subscription request to the item but haven't received an answer yet.
It is necessary to distinguish two things:
Three problems have to be taken into consideration here:
Therefore, the following behavior is RECOMMENDED for Jabber clients:
When the user asks for the removal of an item with subscription='both', the Jabber client SHOULD ask the user whether he wants to revoke the contact's authorization to see the user's presence too. This action SHOULD be called "Remove" since this is the convention used by other IM systems.
The Jabber client SHOULD NOT remove the contact from the roster. There are two exceptions:
The Jabber client MAY remove the contact from the roster if the user explicitely asked (so the user has to be informed he might remove both presence subscriptions).
The jabber client MAY transparently remove the contact from the roster if the user asked to, and if subscription='none' or subscription='to'.
In addition to the "Remove" action described above, the client MAY provide a way to revoke the contact's subscription to the user's presence. This action, if provided, SHOULD be called "Block" since this is the convention used by other IM networks.
Defining a sensible roster policy is difficult, because many users have different, special needs. We have to ensure that:
The user's roster contains both contacts of interest for the user (contacts with subscription='both' or subscription='to') and contacts which are only interested in receiving the user's presence information. Also, the user might be interested in having some contacts even with subscription='none', because he often send messages to them but isn't interested in their presence.
Therefore, the following types of contacts SHOULD be displayed by clients:
The client MAY display contacts with subscription='from' which don't match one of the above cases in an additional 'Observers' group. If no 'Observers' group is used, the client SHOULD NOT display contacts which don't match one of the above rules.
Some users give nicknames to contacts they do not want to see, to be able to remember who they are when cleaning the roster. An additional 'Hidden' group MAY be used to handle such contacts. The client SHOULD NOT display contacts if one of their groups is the 'Hidden' group. (This mean that if contact 'C' is in groups 'G' and 'Hidden', 'C' should never be displayed, even in group 'G'.)