mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-26 05:52:06 +01:00
Make Roster's non-roster presence second-level map bounded
Fixes SMACK-809.
This commit is contained in:
parent
1d438ec1c2
commit
1fd03c396a
1 changed files with 4 additions and 2 deletions
|
@ -382,12 +382,14 @@ public final class Roster extends Manager {
|
|||
private synchronized Map<Resourcepart, Presence> getOrCreatePresencesInternal(BareJid entity) {
|
||||
Map<Resourcepart, Presence> entityPresences = getPresencesInternal(entity);
|
||||
if (entityPresences == null) {
|
||||
entityPresences = new ConcurrentHashMap<>();
|
||||
if (contains(entity)) {
|
||||
entityPresences = new ConcurrentHashMap<>();
|
||||
presenceMap.put(entity, entityPresences);
|
||||
}
|
||||
else {
|
||||
nonRosterPresenceMap.put(entity, entityPresences);
|
||||
LruCache<Resourcepart, Presence> nonRosterEntityPresences = new LruCache<>(32);
|
||||
nonRosterPresenceMap.put(entity, nonRosterEntityPresences);
|
||||
entityPresences = nonRosterEntityPresences;
|
||||
}
|
||||
}
|
||||
return entityPresences;
|
||||
|
|
Loading…
Reference in a new issue