fix: simplify logic for fullname and email blanking in user retrieval (getUserDataByUserSlug)

Previous logic seemed to match the logic used in privileges.users.canEdit, except
the latter allows plugins to modify the value.
isekai-main
Julian Lam 3 years ago
parent 1e2bda13d0
commit 60de084475

@ -43,13 +43,13 @@ helpers.getUserDataByUserSlug = async function (userslug, callerUID, query = {})
userData.emailClass = 'hide';
if (!isAdmin && !isGlobalModerator && !isSelf && (!userSettings.showemail || meta.config.hideEmail)) {
if (!results.canEdit && (!userSettings.showemail || meta.config.hideEmail)) {
userData.email = '';
} else if (!userSettings.showemail) {
userData.emailClass = '';
}
if (!isAdmin && !isGlobalModerator && !isSelf && (!userSettings.showfullname || meta.config.hideFullname)) {
if (!results.canEdit && (!userSettings.showfullname || meta.config.hideFullname)) {
userData.fullname = '';
}

Loading…
Cancel
Save