mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Return struct instead of object path directly for dbus list devices
This commit is contained in:
parent
7829a8d631
commit
c56a8df9b2
3 changed files with 77 additions and 40 deletions
|
@ -145,13 +145,14 @@ public class DbusManagerImpl implements Manager {
|
|||
@Override
|
||||
public List<Device> getLinkedDevices() throws IOException {
|
||||
final var thisDevice = signal.getThisDevice();
|
||||
return signal.listDevices().stream().map(devicePath -> {
|
||||
final var device = getRemoteObject(devicePath, Signal.Device.class).GetAll("org.asamk.Signal.Device");
|
||||
return signal.listDevices().stream().map(d -> {
|
||||
final var device = getRemoteObject(d.getObjectPath(),
|
||||
Signal.Device.class).GetAll("org.asamk.Signal.Device");
|
||||
return new Device((long) device.get("Id").getValue(),
|
||||
(String) device.get("Name").getValue(),
|
||||
(long) device.get("Created").getValue(),
|
||||
(long) device.get("LastSeen").getValue(),
|
||||
thisDevice.equals(devicePath));
|
||||
thisDevice.equals(d.getObjectPath()));
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue