mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: only add blocksCount for self and admins
This commit is contained in:
@@ -59,7 +59,7 @@ helpers.getUserDataByUserSlug = async function (userslug, callerUID) {
|
||||
|
||||
userData.isBlocked = results.isBlocked;
|
||||
if (isAdmin || isSelf) {
|
||||
userData.blocksCount = parseInt(userData.blocksCount, 10) || 0;
|
||||
userData.blocksCount = await user.getUserField(userData.uid, 'blocksCount');
|
||||
}
|
||||
|
||||
userData.yourid = callerUID;
|
||||
|
||||
@@ -72,7 +72,6 @@ userController.getUserDataByUID = async function (callerUid, uid) {
|
||||
|
||||
userData.email = settings.showemail && !meta.config.hideEmail ? userData.email : undefined;
|
||||
userData.fullname = settings.showfullname && !meta.config.hideFullname ? userData.fullname : undefined;
|
||||
userData.blocksCount = undefined;
|
||||
|
||||
return userData;
|
||||
};
|
||||
|
||||
@@ -28,8 +28,8 @@ module.exports = function (User) {
|
||||
'lastonline', 'picture', 'fullname', 'location', 'birthday', 'website',
|
||||
'aboutme', 'signature', 'uploadedpicture', 'profileviews', 'reputation',
|
||||
'postcount', 'topiccount', 'lastposttime', 'banned', 'banned:expire',
|
||||
'status', 'flags', 'followerCount', 'followingCount', 'blocksCount',
|
||||
'cover:url', 'cover:position', 'groupTitle',
|
||||
'status', 'flags', 'followerCount', 'followingCount', 'cover:url',
|
||||
'cover:position', 'groupTitle',
|
||||
];
|
||||
|
||||
User.guestData = {
|
||||
|
||||
Reference in New Issue
Block a user