Remove expiration check from Device#isEnabled()

This commit is contained in:
Jon Chambers
2024-06-07 13:39:11 -04:00
committed by GitHub
parent b376458963
commit 2f55747601
25 changed files with 99 additions and 128 deletions

View File

@@ -440,11 +440,11 @@ public class KeysController {
private List<Device> parseDeviceId(String deviceId, Account account) {
if (deviceId.equals("*")) {
return account.getDevices().stream().filter(Device::isEnabled).toList();
return account.getDevices().stream().filter(Device::hasMessageDeliveryChannel).toList();
}
try {
byte id = Byte.parseByte(deviceId);
return account.getDevice(id).filter(Device::isEnabled).map(List::of).orElse(List.of());
return account.getDevice(id).filter(Device::hasMessageDeliveryChannel).map(List::of).orElse(List.of());
} catch (NumberFormatException e) {
throw new WebApplicationException(Response.status(422).build());
}