1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-12-22 20:47:57 +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;
}
}