Set host online immediately after using Add PC dialog to update host address

This commit is contained in:
Cameron Gutman
2018-12-28 00:54:26 -08:00
parent 90e582a263
commit eca018ad15
+9
View File
@@ -117,6 +117,12 @@
TemporaryHost *existingHost = [self getHostInDiscovery:host.uuid]; TemporaryHost *existingHost = [self getHostInDiscovery:host.uuid];
if (existingHost != nil) { if (existingHost != nil) {
// NB: Our logic here depends on the fact that we never propagate
// the entire TemporaryHost to existingHost. In particular, when mDNS
// discovers a PC and we poll it, we will do so over HTTP which will
// not have accurate pair state. The fields explicitly copied below
// are accurate though.
// Update address of existing host // Update address of existing host
if (host.address != nil) { if (host.address != nil) {
existingHost.address = host.address; existingHost.address = host.address;
@@ -128,6 +134,9 @@
existingHost.externalAddress = host.externalAddress; existingHost.externalAddress = host.externalAddress;
} }
existingHost.activeAddress = host.activeAddress; existingHost.activeAddress = host.activeAddress;
// Set the host online now
existingHost.online = YES;
return NO; return NO;
} }
else { else {