diff --git a/libraries/networking/src/NodeList.cpp b/libraries/networking/src/NodeList.cpp index d960fb6db9..dfb65a70ec 100644 --- a/libraries/networking/src/NodeList.cpp +++ b/libraries/networking/src/NodeList.cpp @@ -751,6 +751,7 @@ bool NodeList::sockAddrBelongsToDomainOrNode(const HifiSockAddr& sockAddr) { } void NodeList::ignoreNodesInRadius(float radiusToIgnore, bool enabled) { + bool isEnabledChange = _ignoreRadiusEnabled.get() != enabled; _ignoreRadiusEnabled.set(enabled); _ignoreRadius.set(radiusToIgnore); @@ -759,6 +760,9 @@ void NodeList::ignoreNodesInRadius(float radiusToIgnore, bool enabled) { }, [this](const SharedNodePointer& destinationNode) { sendIgnoreRadiusStateToNode(destinationNode); }); + if (isEnabledChange) { + emit ignoreRadiusEnabledChanged(enabled); + } } void NodeList::sendIgnoreRadiusStateToNode(const SharedNodePointer& destinationNode) { @@ -886,9 +890,3 @@ void NodeList::muteNodeBySessionID(const QUuid& nodeID) { } } - -void NodeList::toggleIgnoreRadius() { - bool isIgnored = !getIgnoreRadiusEnabled(); - ignoreNodesInRadius(getIgnoreRadius(), isIgnored); - emit ignoreRadiusEnabledChanged(isIgnored); -} \ No newline at end of file diff --git a/libraries/networking/src/NodeList.h b/libraries/networking/src/NodeList.h index c453dbb766..3bf44bbdf4 100644 --- a/libraries/networking/src/NodeList.h +++ b/libraries/networking/src/NodeList.h @@ -74,7 +74,7 @@ public: void ignoreNodesInRadius(float radiusToIgnore, bool enabled = true); float getIgnoreRadius() const { return _ignoreRadius.get(); } bool getIgnoreRadiusEnabled() const { return _ignoreRadiusEnabled.get(); } - void toggleIgnoreRadius(); + void toggleIgnoreRadius() { ignoreNodesInRadius(getIgnoreRadius(), !getIgnoreRadiusEnabled()); } void enableIgnoreRadius() { ignoreNodesInRadius(getIgnoreRadius(), true); } void disableIgnoreRadius() { ignoreNodesInRadius(getIgnoreRadius(), false); } void ignoreNodeBySessionID(const QUuid& nodeID);