1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-24 03:27:59 +01:00

updates roster entries with remote notifications

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2106 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Gaston Dombiak 2003-09-25 13:00:48 +00:00 committed by gdombiak
parent d48175560d
commit 48611ac2f5
2 changed files with 16 additions and 0 deletions

View file

@ -547,6 +547,11 @@ public class Roster {
// Make sure the entry is in the entry list.
if (!entries.contains(entry)) {
entries.add(entry);
} else {
// If the entry was in then list then update its state with the new values
RosterEntry existingEntry =
(RosterEntry) entries.get(entries.indexOf(entry));
existingEntry.updateState(entry.getName(), entry.getType());
}
// If the roster entry belongs to any groups, remove it from the
// list of unfiled entries.

View file

@ -68,6 +68,17 @@ public class RosterEntry {
connection.sendPacket(packet);
}
/**
* Updates the state of the entry with the new values.
*
* @param name the nickname for the entry.
* @param type the subscription type.
*/
void updateState(String name, RosterPacket.ItemType type) {
this.name = name;
this.type = type;
}
/**
* Returns an iterator for all the roster groups that this entry belongs to.
*