Skip to content

Commit b37feb2

Browse files
signal from ignoreNodesInRadius
1 parent 00b9486 commit b37feb2

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

libraries/networking/src/NodeList.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,7 @@ bool NodeList::sockAddrBelongsToDomainOrNode(const HifiSockAddr& sockAddr) {
751751
}
752752

753753
void NodeList::ignoreNodesInRadius(float radiusToIgnore, bool enabled) {
754+
bool isEnabledChange = _ignoreRadiusEnabled.get() != enabled;
754755
_ignoreRadiusEnabled.set(enabled);
755756
_ignoreRadius.set(radiusToIgnore);
756757

@@ -759,6 +760,9 @@ void NodeList::ignoreNodesInRadius(float radiusToIgnore, bool enabled) {
759760
}, [this](const SharedNodePointer& destinationNode) {
760761
sendIgnoreRadiusStateToNode(destinationNode);
761762
});
763+
if (isEnabledChange) {
764+
emit ignoreRadiusEnabledChanged(enabled);
765+
}
762766
}
763767

764768
void NodeList::sendIgnoreRadiusStateToNode(const SharedNodePointer& destinationNode) {
@@ -886,9 +890,3 @@ void NodeList::muteNodeBySessionID(const QUuid& nodeID) {
886890

887891
}
888892
}
889-
890-
void NodeList::toggleIgnoreRadius() {
891-
bool isIgnored = !getIgnoreRadiusEnabled();
892-
ignoreNodesInRadius(getIgnoreRadius(), isIgnored);
893-
emit ignoreRadiusEnabledChanged(isIgnored);
894-
}

libraries/networking/src/NodeList.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class NodeList : public LimitedNodeList {
7474
void ignoreNodesInRadius(float radiusToIgnore, bool enabled = true);
7575
float getIgnoreRadius() const { return _ignoreRadius.get(); }
7676
bool getIgnoreRadiusEnabled() const { return _ignoreRadiusEnabled.get(); }
77-
void toggleIgnoreRadius();
77+
void toggleIgnoreRadius() { ignoreNodesInRadius(getIgnoreRadius(), !getIgnoreRadiusEnabled()); }
7878
void enableIgnoreRadius() { ignoreNodesInRadius(getIgnoreRadius(), true); }
7979
void disableIgnoreRadius() { ignoreNodesInRadius(getIgnoreRadius(), false); }
8080
void ignoreNodeBySessionID(const QUuid& nodeID);

0 commit comments

Comments
 (0)