1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-22 06:39:43 +02:00

Add issue creator real names

This commit is contained in:
Elliott Stoneham 2016-09-05 14:51:10 +01:00
parent 049ff73825
commit b419bd2d52
4 changed files with 34 additions and 21 deletions

View file

@ -171,26 +171,7 @@ func getCommits(client *gogithub.Client, config *githubConfig) ([]githubCommit,
if v.Author != nil {
if v.Author.Login != nil {
al = *v.Author.Login
an = al
if content, found := config.UserNames[al]; found {
if len(content) > 0 {
an = content
}
} else {
usr, _, err := client.Users.Get(al)
if err == nil {
if usr.Name != nil {
if len(*usr.Name) > 0 {
config.UserNames[al] = *usr.Name
an = *usr.Name
}
}
} else {
config.UserNames[al] = al // don't look again for a missing name
}
}
an = getUserName(client, config, al)
}
if v.Author.AvatarURL != nil {
@ -315,6 +296,8 @@ func renderCommits(payload *githubRender, c *githubConfig) error {
payload.HasAuthorStats = len(payload.AuthorStats) > 0
sort.Sort(asToSort(payload.AuthorStats))
payload.NumContributors = len(payload.AuthorStats) - 1
return nil
}