From d6549785080a2874c17de5cfc02db063e2b25b5c Mon Sep 17 00:00:00 2001 From: Ben Lubar Date: Sun, 20 Mar 2016 15:07:11 -0500 Subject: [PATCH] show the crossed-out eye icon for users who want their email private for staff, not just the user --- src/controllers/accounts/helpers.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/controllers/accounts/helpers.js b/src/controllers/accounts/helpers.js index 0a35315854..1cb7bb3c77 100644 --- a/src/controllers/accounts/helpers.js +++ b/src/controllers/accounts/helpers.js @@ -64,12 +64,14 @@ helpers.getUserDataByUserSlug = function(userslug, callerUID, callback) { userData.lastonlineISO = utils.toISOString(userData.lastonline || userData.joindate); userData.age = Math.max(0, userData.birthday ? Math.floor((new Date().getTime() - new Date(userData.birthday).getTime()) / 31536000000) : 0); + userData.emailClass = 'hide'; + if (!(isAdmin || isGlobalModerator || self || (userData.email && userSettings.showemail))) { userData.email = ''; + } else if (!userSettings.showemail) { + userData.emailClass = ''; } - userData.emailClass = (self && !userSettings.showemail) ? '' : 'hide'; - if (!isAdmin && !isGlobalModerator && !self && !userSettings.showfullname) { userData.fullname = ''; } @@ -172,4 +174,4 @@ function filterLinks(links, self) { }); } -module.exports = helpers; \ No newline at end of file +module.exports = helpers;