diff --git a/src/mconnect/device.vala b/src/mconnect/device.vala index ea71e1b..5d6877a 100644 --- a/src/mconnect/device.vala +++ b/src/mconnect/device.vala @@ -361,4 +361,14 @@ class Device : Object { return outgoing_capabilities.contains(capability) || incoming_capabilities.contains(capability); } + + public void update_from_device(Device other_dev) { + outgoing_capabilities = other_dev.outgoing_capabilities; + incoming_capabilities = other_dev.incoming_capabilities; + foreach (var cap in outgoing_capabilities) { + warning("updated cap: %s", cap); + } + host = other_dev.host; + tcp_port = other_dev.tcp_port; + } } \ No newline at end of file diff --git a/src/mconnect/devicemanager.vala b/src/mconnect/devicemanager.vala index 9d23947..9c15473 100644 --- a/src/mconnect/devicemanager.vala +++ b/src/mconnect/devicemanager.vala @@ -123,6 +123,8 @@ class DeviceManager : GLib.Object } var dev = this.devices.@get(unique); + // update device information + dev.update_from_device(new_dev); info("allowed? %s", dev.allowed.to_string()); // check if device is whitelisted in configuration