1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-29 07:22:07 +01:00

Use entries.containsKey in Roster

This commit is contained in:
Florian Schmaus 2014-12-29 18:20:11 +01:00
parent 5d5e3c05c5
commit c8631cf45c

View file

@ -850,7 +850,6 @@ public class Roster {
String from = presence.getFrom();
String key = getPresenceMapKey(from);
Map<String, Presence> userPresences;
RosterEntry entry;
Presence response = null;
// If an "available" presence, add it to the presence map. Each presence
@ -872,8 +871,7 @@ public class Roster {
// Add the new presence, using the resources as a key.
userPresences.put(XmppStringUtils.parseResource(from), presence);
// If the user is in the roster, fire an event.
entry = entries.get(key);
if (entry != null) {
if (entries.containsKey(key)) {
fireRosterPresenceEvent(presence);
}
break;
@ -900,8 +898,7 @@ public class Roster {
userPresences.put(XmppStringUtils.parseResource(from), presence);
}
// If the user is in the roster, fire an event.
entry = entries.get(key);
if (entry != null) {
if (entries.containsKey(key)) {
fireRosterPresenceEvent(presence);
}
break;
@ -954,8 +951,7 @@ public class Roster {
// Set the new presence using the empty resource as a key.
userPresences.put("", presence);
// If the user is in the roster, fire an event.
entry = entries.get(key);
if (entry != null) {
if (entries.containsKey(key)) {
fireRosterPresenceEvent(presence);
}
break;