diff options
Diffstat (limited to 'models/action.go')
-rw-r--r-- | models/action.go | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/models/action.go b/models/action.go index 4f57d1b3b5..5bfa5b75b2 100644 --- a/models/action.go +++ b/models/action.go @@ -234,11 +234,13 @@ func issueIndexTrimRight(c rune) bool { } type PushCommit struct { - Sha1 string - Message string - AuthorEmail string - AuthorName string - Timestamp time.Time + Sha1 string + Message string + AuthorEmail string + AuthorName string + CommitterEmail string + CommitterName string + Timestamp time.Time } type PushCommits struct { @@ -263,6 +265,12 @@ func (pc *PushCommits) ToApiPayloadCommits(repoLink string) []*api.PayloadCommit if err == nil { authorUsername = author.Name } + committerUsername := "" + committer, err := GetUserByEmail(commit.CommitterEmail) + if err == nil { + // TODO: check errors other than email not found. + committerUsername = committer.Name + } commits[i] = &api.PayloadCommit{ ID: commit.Sha1, Message: commit.Message, @@ -272,6 +280,11 @@ func (pc *PushCommits) ToApiPayloadCommits(repoLink string) []*api.PayloadCommit Email: commit.AuthorEmail, UserName: authorUsername, }, + Committer: &api.PayloadCommitter{ + Name: commit.CommitterName, + Email: commit.CommitterEmail, + UserName: committerUsername, + }, Timestamp: commit.Timestamp, } } |