Don't consider changes to location details as update-worthy if we're not discoverable.

This commit is contained in:
Howard Stearns 2017-03-29 17:55:57 -07:00
parent 3a7edebb94
commit af25e0e21f

View file

@ -51,12 +51,13 @@ void DiscoverabilityManager::updateLocation() {
QString pathString = addressManager->currentPath();
const QString PATH_KEY_IN_LOCATION = "path";
locationObject.insert(PATH_KEY_IN_LOCATION, pathString);
const QString CONNECTED_KEY_IN_LOCATION = "connected";
locationObject.insert(CONNECTED_KEY_IN_LOCATION, discoverable && domainHandler.isConnected());
if (discoverable) { // Don't consider changes to these as update-worthy if we're not discoverable.
const QString PATH_KEY_IN_LOCATION = "path";
locationObject.insert(PATH_KEY_IN_LOCATION, pathString);
if (!addressManager->getRootPlaceID().isNull()) {
const QString PLACE_ID_KEY_IN_LOCATION = "place_id";
locationObject.insert(PLACE_ID_KEY_IN_LOCATION,
@ -76,6 +77,7 @@ void DiscoverabilityManager::updateLocation() {
const QString NETWORK_ADDRESS_PORT_IN_LOCATION = "network_port";
locationObject.insert(NETWORK_ADDRESS_PORT_IN_LOCATION, domainSockAddr.getPort());
}
const QString AVAILABILITY_KEY_IN_LOCATION = "availability";
locationObject.insert(AVAILABILITY_KEY_IN_LOCATION, findableByString(static_cast<Discoverability::Mode>(_mode.get())));