diff options
author | harry <harryzhxu@gmail.com> | 2017-10-23 03:50:07 -0500 |
---|---|---|
committer | Bo-Yi Wu <appleboy.tw@gmail.com> | 2017-10-23 03:50:07 -0500 |
commit | 81d1e54a49cc61e64608ff2aee055110c7e4f811 (patch) | |
tree | 70b5efe8835127be80c3cbe30f42bccad0a7bdd8 /modules/base | |
parent | e4990ba205d56f7b6fda990d6c2d19a60b35fc56 (diff) | |
download | gitea-81d1e54a49cc61e64608ff2aee055110c7e4f811.tar.gz gitea-81d1e54a49cc61e64608ff2aee055110c7e4f811.zip |
Use identicon image for default gravatar. (#2767)
* Use identicon image for default gravatar.
* Fixed tests.
Diffstat (limited to 'modules/base')
-rw-r--r-- | modules/base/tool.go | 2 | ||||
-rw-r--r-- | modules/base/tool_test.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/modules/base/tool.go b/modules/base/tool.go index 26ced075da..194db772cf 100644 --- a/modules/base/tool.go +++ b/modules/base/tool.go @@ -211,7 +211,7 @@ func AvatarLink(email string) string { } if !setting.DisableGravatar { - return setting.GravatarSource + HashEmail(email) + return setting.GravatarSource + HashEmail(email) + "?d=identicon" } return DefaultAvatarLink() diff --git a/modules/base/tool_test.go b/modules/base/tool_test.go index f3e787dd13..44ea309f7c 100644 --- a/modules/base/tool_test.go +++ b/modules/base/tool_test.go @@ -135,7 +135,7 @@ func TestAvatarLink(t *testing.T) { setting.DisableGravatar = false assert.Equal(t, - "353cbad9b58e69c96154ad99f92bedc7", + "353cbad9b58e69c96154ad99f92bedc7?d=identicon", AvatarLink("gitea@example.com"), ) } |