RFC 3921
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='subscribe', 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 sends 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'.)
The name of the 'Hidden' group can be managed in two different ways :
This is left as an open issue since no clients (to the author's knowledge) implement this 'Hidden' group. But the preference should go to the first solution, which avoids relying on Private XML Storage (XEP-0049)