1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-09-10 02:39:42 +02:00

Create smack-im subproject for XMPP-IM

Move Roster and Chat(Manager) code into their own packages within the
new smack-im subproject.

Apply Manager pattern to Roster.

Fixes SMACK-637.
This commit is contained in:
Florian Schmaus 2015-01-22 13:53:50 +01:00
parent e722018808
commit d5b8647d9d
47 changed files with 392 additions and 271 deletions

View file

@ -8,7 +8,7 @@ users. A roster also allows you to organize users into groups such as
"Friends" and "Co-workers". Other IM systems refer to the roster as the buddy
list, contact list, etc.
A `Roster` instance is obtained using the `XMPPConnection.getRoster()` method.
A `Roster` instance is obtained using the `Roster.getInstanceFor(XMPPConnection)` method.
Roster Entries
--------------
@ -20,7 +20,7 @@ Every user in a roster is represented by a RosterEntry, which consists of:
* 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:
```
Roster roster = connection.getRoster();
Roster roster = Roster.getInstanceFor(connection);
Collection<RosterEntry> entries = roster.getEntries();
for (RosterEntry entry : entries) {
System.out.println(entry);
@ -63,7 +63,7 @@ out. A normal client would use similar code to update the roster UI with the
changing information.
```
Roster roster = con.getRoster();
Roster roster = Roster.getInstanceFor(con);
roster.addRosterListener(new RosterListener() {
// Ignored events public void entriesAdded(Collection<String> addresses) {}
public void entriesDeleted(Collection<String> addresses) {}