diff --git a/assignment-client/src/audio/AudioMixer.h b/assignment-client/src/audio/AudioMixer.h index 353db84a15..5c98475790 100644 --- a/assignment-client/src/audio/AudioMixer.h +++ b/assignment-client/src/audio/AudioMixer.h @@ -62,7 +62,6 @@ private slots: void handleNegotiateAudioFormat(QSharedPointer message, SharedNodePointer sendingNode); void handleNodeKilled(SharedNodePointer killedNode); void handleNodeIgnoreRequestPacket(QSharedPointer packet, SharedNodePointer sendingNode); - void handleNodeUnignoreRequestPacket(QSharedPointer packet, SharedNodePointer sendingNode); void handleNodePersonalMuteRequestPacket(QSharedPointer packet, SharedNodePointer sendingNode); void handleNodePersonalMuteStatusRequestPacket(QSharedPointer packet, SharedNodePointer sendingNode); void handleRadiusIgnoreRequestPacket(QSharedPointer packet, SharedNodePointer sendingNode); diff --git a/assignment-client/src/avatars/AvatarMixer.h b/assignment-client/src/avatars/AvatarMixer.h index 865dd36106..5d54622ac9 100644 --- a/assignment-client/src/avatars/AvatarMixer.h +++ b/assignment-client/src/avatars/AvatarMixer.h @@ -41,7 +41,6 @@ private slots: void handleAvatarIdentityPacket(QSharedPointer message, SharedNodePointer senderNode); void handleKillAvatarPacket(QSharedPointer message); void handleNodeIgnoreRequestPacket(QSharedPointer message, SharedNodePointer senderNode); - void handleNodeUnignoreRequestPacket(QSharedPointer message, SharedNodePointer senderNode); void handleRadiusIgnoreRequestPacket(QSharedPointer packet, SharedNodePointer sendingNode); void handleRequestsDomainListDataPacket(QSharedPointer message, SharedNodePointer senderNode); void domainSettingsRequestComplete(); diff --git a/interface/resources/qml/hifi/Pal.qml b/interface/resources/qml/hifi/Pal.qml index 07f9386b2a..fc55916832 100644 --- a/interface/resources/qml/hifi/Pal.qml +++ b/interface/resources/qml/hifi/Pal.qml @@ -398,7 +398,6 @@ Item { myData.audioLevel = audioLevel; myCard.audioLevel = audioLevel; // Defensive programming } else { - console.log("userid:" + userId); var userIndex = findSessionIndex(userId); userModel.get(userIndex).audioLevel = audioLevel; userData[userIndex].audioLevel = audioLevel; // Defensive programming @@ -410,14 +409,7 @@ Item { var enabled = message.params[1]; var userIndex = findSessionIndex(userId); userModel.get(userIndex).personalMute.property = enabled; - userData[userIndex].personalMute.property = enabled; // Defensive programming - break; - case 'updateIgnoredStatus': - var userId = message.params[0]; - var enabled = message.params[1]; - var userIndex = findSessionIndex(userId); - userModel.get(userIndex).ignore.property = enabled; - userData[userIndex].ignore.property = enabled; // Defensive programming + userData[userIndex].personalMute.property = enabled; // Defensive programming break; default: console.log('Unrecognized message:', JSON.stringify(message)); diff --git a/libraries/networking/src/NodeList.cpp b/libraries/networking/src/NodeList.cpp index 89b5590025..0657b2c5ac 100644 --- a/libraries/networking/src/NodeList.cpp +++ b/libraries/networking/src/NodeList.cpp @@ -795,7 +795,8 @@ void NodeList::ignoreNodeBySessionID(const QUuid& nodeID, bool ignoreEnabled) { ignorePacket->write(nodeID.toRfc4122()); ignorePacket->writePrimitive(ignoreEnabled); - qCDebug(networking) << "Sending packet to" << (ignoreEnabled ? "ignore" : "unignore") << "node" << uuidStringWithoutCurlyBraces(nodeID); + qCDebug(networking) << "Sending packet to" << (destinationNode->getType() == NodeType::AudioMixer ? "AudioMixer" : "AvatarMixer") << "to" + << (ignoreEnabled ? "ignore" : "unignore") << "node" << uuidStringWithoutCurlyBraces(nodeID); // send off this ignore packet reliably to the matching node sendPacket(std::move(ignorePacket), *destinationNode); @@ -849,18 +850,6 @@ void NodeList::maybeSendIgnoreSetToNode(SharedNodePointer newNode) { } } -void NodeList::processPersonalMuteStatusReply(QSharedPointer message) { - // read the UUID from the packet - QString nodeUUIDString = (QUuid::fromRfc4122(message->readWithoutCopy(NUM_BYTES_RFC4122_UUID))).toString(); - // read the personal mute status - bool isPersonalMuted; - message->readPrimitive(&isPersonalMuted); - - qCDebug(networking) << "Got personal muted status" << isPersonalMuted << "for node" << nodeUUIDString; - - emit personalMuteStatusReply(nodeUUIDString, isPersonalMuted); -} - void NodeList::personalMuteNodeBySessionID(const QUuid& nodeID, bool muteEnabled) { // cannot personal mute yourself, or nobody if (!nodeID.isNull() && _sessionUUID != nodeID) { diff --git a/libraries/script-engine/src/UsersScriptingInterface.cpp b/libraries/script-engine/src/UsersScriptingInterface.cpp index b558c2572d..f18eef27cb 100644 --- a/libraries/script-engine/src/UsersScriptingInterface.cpp +++ b/libraries/script-engine/src/UsersScriptingInterface.cpp @@ -29,9 +29,9 @@ void UsersScriptingInterface::ignore(const QUuid& nodeID, bool ignoreEnabled) { DependencyManager::get()->ignoreNodeBySessionID(nodeID, ignoreEnabled); } -void UsersScriptingInterface::requestIgnoreStatus(const QUuid& nodeID) { - // ask the Audio Mixer via the NodeList for the Personal Mute status associated with the given session ID - DependencyManager::get()->isIgnoringNode(nodeID); +bool UsersScriptingInterface::getIgnoreStatus(const QUuid& nodeID) { + // ask the NodeList for the Ignore status associated with the given session ID + return DependencyManager::get()->isIgnoringNode(nodeID); } void UsersScriptingInterface::personalMute(const QUuid& nodeID, bool muteEnabled) { diff --git a/libraries/script-engine/src/UsersScriptingInterface.h b/libraries/script-engine/src/UsersScriptingInterface.h index 05082602b8..f7b25a72c2 100644 --- a/libraries/script-engine/src/UsersScriptingInterface.h +++ b/libraries/script-engine/src/UsersScriptingInterface.h @@ -40,11 +40,11 @@ public slots: void ignore(const QUuid& nodeID, bool ignoreEnabled); /**jsdoc - * Requests a bool containing whether you have ignored the given Avatar UUID. - * @function Users.requestIgnoreStatus + * Gets a bool containing whether you have ignored the given Avatar UUID. + * @function Users.getIgnoreStatus * @param {nodeID} nodeID The node or session ID of the user whose ignore status you want. */ - void requestIgnoreStatus(const QUuid& nodeID); + bool getIgnoreStatus(const QUuid& nodeID); /**jsdoc * Mute another user for you and you only. @@ -138,12 +138,6 @@ signals: */ void personalMuteStatusReply(const QString& nodeID, bool isPersonalMuted); - /**jsdoc - * Notifies scripts of the Ignore status associated with a UUID. - * @function Users.ignoreStatusReply - */ - void ignoreStatusReply(const QString& nodeID, bool isIgnored); - private: bool getRequestsDomainListData(); void setRequestsDomainListData(bool requests); diff --git a/scripts/system/pal.js b/scripts/system/pal.js index 2e35ff3d6e..a21eb8c6ef 100644 --- a/scripts/system/pal.js +++ b/scripts/system/pal.js @@ -137,7 +137,7 @@ function populateUserList() { // (as long as we're not requesting it for our own ID) if (id) { Users.requestPersonalMuteStatus(id); - Users.requestIgnoreStatus(id); + avatarPalDatum['ignore'] = Users.getIgnoreStatus(id); } data.push(avatarPalDatum); if (id) { // No overlay for ourself. @@ -173,14 +173,6 @@ function personalMuteStatusReply(id, isPersonalMuted) { pal.sendToQml({ method: 'updatePersonalMutedStatus', params: data }); } -// The function that handles the ignored status from the AudioMixer/AvatarMixer -function ignoreStatusReply(id, isIgnored) { - var data = [id, isIgnored]; - print('Ignored Status Data:', JSON.stringify(data)); - // Ship the data off to QML - pal.sendToQml({ method: 'updateIgnoredStatus', params: data }); -} - var pingPong = true; function updateOverlays() { var eye = Camera.position; @@ -352,7 +344,6 @@ pal.visibleChanged.connect(onVisibleChanged); pal.closed.connect(off); Users.usernameFromIDReply.connect(usernameFromIDReply); Users.personalMuteStatusReply.connect(personalMuteStatusReply); -Users.ignoreStatusReply.connect(ignoreStatusReply); function onIgnore(sessionId) { // make it go away in the usual way, since we'll still get data keeping it live // Why doesn't this work from .qml? (crashes) @@ -371,7 +362,6 @@ Script.scriptEnding.connect(function () { Users.usernameFromIDReply.disconnect(usernameFromIDReply); Users.ignoredNode.disconnect(onIgnore); Users.personalMuteStatusReply.disconnect(personalMuteStatusReply); - Users.ignoreStatusReply.disconnect(ignoreStatusReply); off(); });