1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-23 02:58:00 +01:00

Fixes for roster presence notification.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2060 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Matt Tucker 2003-08-23 23:09:18 +00:00 committed by mtucker
parent 224d0a17a7
commit aa3920da05

View file

@ -408,10 +408,15 @@ public class Roster {
if (presence.getType() == Presence.Type.AVAILABLE) {
presenceMap.put(key, presence);
// If the user is in the roster, fire an event.
if (entries.contains(key)) {
synchronized (entries) {
for (Iterator i=entries.iterator(); i.hasNext(); ) {
RosterEntry entry = (RosterEntry)i.next();
if (entry.getUser().equals(key)) {
fireRosterPresenceEvent(key);
}
}
}
}
// If an "unavailable" packet, remove any entries in the presence map.
else if (presence.getType() == Presence.Type.UNAVAILABLE) {
presenceMap.remove(key);