mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-21 17:26:29 -05:00
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
1 changed files with 3 additions and 3 deletions
|
@ -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…
Reference in a new issue