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 <github@erik.michelson.eu>
This commit is contained in:
parent
6e983ba5dc
commit
d8faf3e342
@ -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'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user