diff options
author | John Olheiser <42128690+jolheiser@users.noreply.github.com> | 2019-10-18 03:33:19 -0500 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2019-10-18 16:33:19 +0800 |
commit | 7c4c01c0fda90d94cf3785f27b505d9fc502fee6 (patch) | |
tree | 073304af25f97daf419932f795668e333923eab5 /models/webhook_discord.go | |
parent | d44053eeda9128fb2e8f74205db6b998e7820fa2 (diff) | |
download | gitea-7c4c01c0fda90d94cf3785f27b505d9fc502fee6.tar.gz gitea-7c4c01c0fda90d94cf3785f27b505d9fc502fee6.zip |
Fix review webhooks (#8570)
Signed-off-by: jolheiser <john.olheiser@gmail.com>
Diffstat (limited to 'models/webhook_discord.go')
-rw-r--r-- | models/webhook_discord.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/models/webhook_discord.go b/models/webhook_discord.go index d7a2de0d11..0b190495f2 100644 --- a/models/webhook_discord.go +++ b/models/webhook_discord.go @@ -413,7 +413,17 @@ func getDiscordPullRequestApprovalPayload(p *api.PullRequestPayload, meta *Disco title = fmt.Sprintf("[%s] Pull request review %s: #%d %s", p.Repository.FullName, action, p.Index, p.PullRequest.Title) text = p.PullRequest.Body - color = warnColor + + switch event { + case HookEventPullRequestApproved: + color = successColor + case HookEventPullRequestRejected: + color = failedColor + case HookEventPullRequestComment: + fallthrough + default: + color = warnColor + } } return &DiscordPayload{ |