Every user in a roster is represented by a RosterEntry, which consists of:
* An XMPP address (e.g. jsmith@example.com).
* A name you've assigned to the user (e.g. "Joe").
* The list of groups in the roster that the entry belongs to. If the roster entry belongs to no groups, it's called an "unfiled entry". The following code snippet prints all entries in the roster:
Rosters and presence use a permissions-based model where users must give
permission before they are added to someone else's roster. This protects a
user's privacy by making sure that only approved users are able to view their
presence information. Therefore, when you add a new roster entry it will be in
a pending state until the other user accepts your request.
If another user requests a presence subscription so they can add you to their
roster, you must accept or reject that request. Smack handles presence
subscription requests in one of three ways:
* Automatically accept all presence subscription requests.
* Automatically reject all presence subscription requests.
* Process presence subscription requests manually. The mode can be set using the `Roster.setSubscriptionMode(Roster.SubscriptionMode)` method. Simple clients normally use one of the automated subscription modes, while full-featured clients should manually process subscription requests and let the end-user accept or reject each request. If using the manual mode, a PacketListener should be registered that listens for Presence packets that have a type of `Presence.Type.subscribe`.