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
1 changed files with 7 additions and 1 deletions

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;
}
}