Skip to content

Commit 81d1e54

Browse files
harryxuappleboy
authored andcommitted
Use identicon image for default gravatar. (#2767)
* Use identicon image for default gravatar. * Fixed tests.
1 parent e4990ba commit 81d1e54

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

models/action_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,11 @@ func TestPushCommits_AvatarLink(t *testing.T) {
146146
pushCommits.Len = len(pushCommits.Commits)
147147

148148
assert.Equal(t,
149-
"https://secure.gravatar.com/avatar/ab53a2911ddf9b4817ac01ddcd3d975f",
149+
"https://secure.gravatar.com/avatar/ab53a2911ddf9b4817ac01ddcd3d975f?d=identicon",
150150
pushCommits.AvatarLink("[email protected]"))
151151

152152
assert.Equal(t,
153-
"https://secure.gravatar.com/avatar/19ade630b94e1e0535b3df7387434154",
153+
"https://secure.gravatar.com/avatar/19ade630b94e1e0535b3df7387434154?d=identicon",
154154
pushCommits.AvatarLink("[email protected]"))
155155
}
156156

modules/base/tool.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ func AvatarLink(email string) string {
211211
}
212212

213213
if !setting.DisableGravatar {
214-
return setting.GravatarSource + HashEmail(email)
214+
return setting.GravatarSource + HashEmail(email) + "?d=identicon"
215215
}
216216

217217
return DefaultAvatarLink()

modules/base/tool_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ func TestAvatarLink(t *testing.T) {
135135

136136
setting.DisableGravatar = false
137137
assert.Equal(t,
138-
"353cbad9b58e69c96154ad99f92bedc7",
138+
"353cbad9b58e69c96154ad99f92bedc7?d=identicon",
139139
AvatarLink("[email protected]"),
140140
)
141141
}

0 commit comments

Comments
 (0)