From d8faf3e3423e61c63987d8376408fa21d2a6a392 Mon Sep 17 00:00:00 2001 From: Erik Michelson Date: Fri, 7 Jan 2022 14:03:26 +0100 Subject: [PATCH] Use identicons as fallback for libravatar The usage of identicons makes users more distinguishable as when only the default librvatar image is used. This only applies to users that have no avatar on libravatar or gravatar. Signed-off-by: Erik Michelson --- lib/letter-avatars.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/letter-avatars.js b/lib/letter-avatars.js index bb7a9fe8b..d9000ef9e 100644 --- a/lib/letter-avatars.js +++ b/lib/letter-avatars.js @@ -37,11 +37,11 @@ exports.generateAvatarURL = function (name, email = '', big = true) { const hexDigest = hash.digest('hex') if (email !== '' && config.allowGravatar) { - photo = 'https://cdn.libravatar.org/avatar/' + hexDigest + photo = `https://cdn.libravatar.org/avatar/${hexDigest}?default=identicon` if (big) { - photo += '?s=400' + photo += '&s=400' } else { - photo += '?s=96' + photo += '&s=96' } } else { photo = config.serverURL + '/user/' + (name || email.substring(0, email.lastIndexOf('@')) || hexDigest) + '/avatar.svg'