test: dont return cover:url if its not requested

This commit is contained in:
Barış Soner Uşaklı
2026-02-08 20:46:16 -05:00
parent db07456bc0
commit e4d852b4ca

View File

@@ -267,10 +267,11 @@ module.exports = function (User) {
user.picture = user.uploadedpicture;
}
}
user['cover:url'] = user['cover:url'] ?
prependRelativePath(user['cover:url']) :
coverPhoto.getDefaultProfileCover(user.uid);
if (user.hasOwnProperty('cover:url')) {
user['cover:url'] = user['cover:url'] ?
prependRelativePath(user['cover:url']) :
coverPhoto.getDefaultProfileCover(user.uid);
}
if (meta.config.defaultAvatar && !user.picture) {
user.picture = User.getDefaultAvatar();