From 95e2f0687df1aecd12c59046df715739918dd519 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Fri, 16 Dec 2016 14:18:28 -0800 Subject: [PATCH] It's working! Untested on human avatars. --- interface/resources/qml/hifi/Pal.qml | 15 +++++++++++---- scripts/system/pal.js | 7 ++++++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/interface/resources/qml/hifi/Pal.qml b/interface/resources/qml/hifi/Pal.qml index 85b1c83ad3..b1b3a00c27 100644 --- a/interface/resources/qml/hifi/Pal.qml +++ b/interface/resources/qml/hifi/Pal.qml @@ -75,10 +75,17 @@ Rectangle { case 'updateUsername': var userId = message.params[0]; var userName = message.params[1]; - var userIndex = findSessionIndex(userId); - console.log('computed userIndex:', userIndex); - userModel.get(userIndex).userName = userName; - userData[userIndex].userName = userName; + console.log('passed userId:', userId); + console.log('passed userName:', userName); + if (!userId) { + myData.userName = userName; + myCard.userName = userName; + } else { + var userIndex = findSessionIndex(userId); + console.log('computed userIndex:', userIndex); + userModel.get(userIndex).userName = userName; + userData[userIndex].userName = userName; + } break; default: console.log('Unrecognized message:', JSON.stringify(message)); diff --git a/scripts/system/pal.js b/scripts/system/pal.js index 1b04f75836..0575a02abe 100644 --- a/scripts/system/pal.js +++ b/scripts/system/pal.js @@ -134,7 +134,12 @@ function populateUserList() { } function usernameFromID(id, username) { - var data = [id, username + '/' + id ]; + var data; + if (AvatarList.getAvatar('').sessionUUID === id) { + data = ['', username + ' (hidden)'] + } else { + data = [id, username + '/' + id]; + } print('Username Data:', JSON.stringify(data)); pal.sendToQml({ method: 'updateUsername', params: data }); }