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

Avoid returning empty set of deviceIds in caching store

This commit is contained in:
Paul Schaub 2019-12-13 18:26:40 +01:00
parent a8b2446042
commit 2391cffa97

View file

@ -75,7 +75,13 @@ public class CachingOmemoStore<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey, T_Se
if (persistent != null) {
return persistent.localDeviceIdsOf(localUser);
} else {
return new TreeSet<>(); //TODO: ?
SortedSet<Integer> deviceIds = new TreeSet<>();
for (OmemoDevice device : caches.keySet()) {
if (device.getJid().equals(localUser)) {
deviceIds.add(device.getDeviceId());
}
}
return deviceIds;
}
}