jabber:iq:roster
In Section 5.4.2.3 in Chapter 5,
we looked at the presence subscription mechanism
used to coordinate and record information about the relationships
between users and how they exchange availability information. This mechanism
revolves around certain types of <presence/>
elements and storage of information in the users’ rosters.
The roster structure is managed within the jabber:iq:roster
namespace. Clients make roster requests when they connect to the Jabber server,
to pull down the roster that is stored server-side. They also update
the roster to add, change, or remove entries. However, roster updates aren’t limited to just the client; there are certain attributes within each roster
item that are maintained by the server, in response to presence subscription
activity.
The roster in Example 6-5 contains five items. Three
are friends, grouped together using
<group>Friends</group>, which is used by clients to build the roster item display in a structured (hierarchical) way.
<query xmlns='jabber:iq:roster'> <item jid='shiels@jabber.org' subscription='both' name='Robert'> <group>Friends</group> </item> <item jid='piers@jabber.org' subscription='both' name='piers'> <group>Friends</group> </item> <item jid='sabine@pipetree.com' subscription='to' name='Sabine'> <group>Friends</group> </item> <item jid='jim@company-a.com' subscription='from' name='Jim'> <group>Work</group> </item> <item jid='jim@company-b.com' subscription='none' ask='subscribe' ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access