Skip to content

Commit 20ea925

Browse files
authored
feat: custom user commit icons (#825)
1 parent e9500ee commit 20ea925

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

package.json

+8
Original file line numberDiff line numberDiff line change
@@ -1064,6 +1064,14 @@
10641064
"description": "Use garavatar icons in log viewers",
10651065
"default": true
10661066
},
1067+
"svn.gravatar.icon_url": {
1068+
"type": "string",
1069+
"description": "Url for the gravitar icon using the <AUTHOR>, <AUTHOR_MD5> and <SIZE> placeholders",
1070+
"examples": [
1071+
"https://www.gravatar.com/avatar/<AUTHOR_MD5>.jpg?s=<SIZE>&d=https%3A%2F%2Fui-avatars.com%2Fapi%2F/<AUTHOR>/128"
1072+
],
1073+
"default": "https://www.gravatar.com/avatar/<AUTHOR_MD5>.jpg?s=<SIZE>&d=robohash"
1074+
},
10671075
"svn.ignoreMissingSvnWarning": {
10681076
"type": "boolean",
10691077
"description": "Ignores the warning when SVN is missing",

src/historyView/common.ts

+7-3
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,13 @@ export function getCommitIcon(
214214
return gravatar;
215215
}
216216

217-
gravatar = Uri.parse(
218-
`https://www.gravatar.com/avatar/${md5(author)}.jpg?s=${size}&d=robohash`
219-
);
217+
const gravitarUrl = configuration
218+
.get("gravatar.icon_url", "")
219+
.replace("<AUTHOR>", author)
220+
.replace("<AUTHOR_MD5>", md5(author))
221+
.replace("<SIZE>", size.toString());
222+
223+
gravatar = Uri.parse(gravitarUrl);
220224

221225
gravatarCache.set(author, gravatar);
222226

0 commit comments

Comments
 (0)