You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

199 lines
8.0 KiB

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE xep SYSTEM 'xep.dtd' [
<!ENTITY % ents SYSTEM 'xep.ent'>
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
<title>Best Practices for Roster and Subscription Management</title>
<abstract>This document specifies best practices for roster and subscription management in Jabber/XMPP clients.</abstract>
<remark>Fixed small typos</remark>
<remark>Added a note about the name of the Hidden group. Clarified which items should be displayed.</remark>
<remark>Initial version.</remark>
<remark>Added a remark about "Remove" vs "Block" in other IM systems.</remark>
<remark>Integrated some feedback from Standards list discussion.</remark>
<remark>First draft.</remark>
<section1 topic='Introduction' anchor='intro'>
<section2 topic='Motivation' anchor='intro-motive'>
<p>&rfc3921; 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 document 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.</p>
<section2 topic='Overview of subscription states' anchor='intro-oversub'>
<p>As defined in RFC 3921 (sections 6, 7, 8), a roster item can have one
of the following subscription states:</p>
<li><em>subscription='none'</em>: you aren't interested in the item's
presence, and neither is the item interested in yours.</li>
<li><em>subscription='from'</em>: the item is interested in your
presence information, but you don't care about the contact. (You must
be somebody important! ;)</li>
<li><em>subscription='to'</em>: You are interested in the item's
presence information, but the contact is not interested in
<li><em>subscription='both'</em>: You and the contact are interested in each other's presence information.</li>
<p>Additionally, if <em>subscription='from'</em> or
<em>subscription='none'</em>, you can have <em>ask='subscribe'</em>, which
means you sent a subscription request to the item but haven't received an
answer yet.</p>
<section1 topic='Removal of Contacts' anchor='removal'>
<p>It is necessary to distinguish two things:</p>
<li>Removal from the user's roster (does the user's roster include an entry
for this JID?) ;</li>
<li>Removal of presence subscription (cancellation of subscription).</li>
<p>Three problems have to be taken into consideration here:</p>
<li>Removing an item from your roster (i.e., performing a roster set with <em>subscription='remove'</em>) cancels all subscriptions (both from
the item and to the item).</li>
<li>The fact that a user is no longer interested in the contact's
presence doesn't mean that the contact is no longer interested in the
user's presence.</li>
<li>This is complex, and should be presented in a simple way to the
<p>Therefore, the following behavior is RECOMMENDED for Jabber clients:</p>
<li><p>When the user asks for the removal of an item with
<em>subscription='both'</em>, 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.</p></li>
<p>The Jabber client SHOULD NOT remove the contact from the roster. There
are two exceptions:</p>
<ol style='list-style-type: lower-alpha'>
<li><p>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).</p></li>
<li><p>The jabber client MAY transparently remove the contact from the roster if
the user asked to, and if <em>subscription='none'</em> or
<p>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.</p>
<section1 topic='Display of Contacts in the Roster' anchor='contacts'>
<p>Defining a sensible roster policy is difficult, because many users have different, special needs. We have to ensure that:</p>
<li>Most contacts that everybody wants to hide are hidden.</li>
<li>No contact that someone wants to see is hidden.</li>
<p>The user's roster contains both contacts of interest for the user
(contacts with <em>subscription='both'</em> or <em>subscription='to'</em>) 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
<em>subscription='none'</em>, because he often sends messages to them but isn't
interested in their presence.</p>
<p>Therefore, the following types of contacts SHOULD be displayed by clients:</p>
<li>items with <em>subscription='both'</em> or <em>subscription='to'</em> ;</li>
<li>items with <em>subscription='none'</em> or <em>subscription='from'</em> and <em>ask='subscribe'</em>. It is ((subscription='none' or subscription='from') and ask='subscribe') ;</li>
<li>items with <em>subscription='none'</em> or <em>subscription='from'</em> which have a 'name' attribute or a 'group' child set. It is ((subscription='none' or subscription='from') and (name attribute or group child)).</li>
<p>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.</p>
<p>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'.)</p>
<section2 topic='Name of the Hidden group' anchor='hiddenname'>
<p>The name of the 'Hidden' group can be managed in two different ways :</p>
<li>It could always be named 'Hidden' but be displayed translated by the client ;</li>
<li>It could be named as the user wants. Its name could then be stored using jabber:iq:private, like the delimiter for nested groups in &xep0083;.</li>
<p>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 &xep0049;.</p>