diff options
author | Lanre Adelowo <adelowomailbox@gmail.com> | 2019-02-03 19:31:58 +0100 |
---|---|---|
committer | techknowlogick <matti@mdranta.net> | 2019-02-03 13:31:58 -0500 |
commit | 746cf22d8ae981237bda801c1de691fbede21df9 (patch) | |
tree | 9ed10b57411f91dd6a02eb3176df3f5431055f8c /models | |
parent | 13c0f7dfffc99c58c1c53f3bc0c6eaf17c3860f8 (diff) | |
download | gitea-746cf22d8ae981237bda801c1de691fbede21df9.tar.gz gitea-746cf22d8ae981237bda801c1de691fbede21df9.zip |
handle milestone events for issues and PR (#5947)
Diffstat (limited to 'models')
-rw-r--r-- | models/webhook_slack.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/models/webhook_slack.go b/models/webhook_slack.go index 3a21f98601..5c67951fba 100644 --- a/models/webhook_slack.go +++ b/models/webhook_slack.go @@ -160,6 +160,10 @@ func getSlackIssuesPayload(p *api.IssuePayload, slack *SlackMeta) (*SlackPayload text = fmt.Sprintf("[%s] Issue labels cleared: %s by %s", p.Repository.FullName, titleLink, senderLink) case api.HookIssueSynchronized: text = fmt.Sprintf("[%s] Issue synchronized: %s by %s", p.Repository.FullName, titleLink, senderLink) + case api.HookIssueMilestoned: + text = fmt.Sprintf("[%s] Issue milestoned: #%s %s", p.Repository.FullName, titleLink, senderLink) + case api.HookIssueDemilestoned: + text = fmt.Sprintf("[%s] Issue milestone cleared: #%s %s", p.Repository.FullName, titleLink, senderLink) } return &SlackPayload{ @@ -312,6 +316,10 @@ func getSlackPullRequestPayload(p *api.PullRequestPayload, slack *SlackMeta) (*S text = fmt.Sprintf("[%s] Pull request labels cleared: %s by %s", p.Repository.FullName, titleLink, senderLink) case api.HookIssueSynchronized: text = fmt.Sprintf("[%s] Pull request synchronized: %s by %s", p.Repository.FullName, titleLink, senderLink) + case api.HookIssueMilestoned: + text = fmt.Sprintf("[%s] Pull request milestoned: #%s %s", p.Repository.FullName, titleLink, senderLink) + case api.HookIssueDemilestoned: + text = fmt.Sprintf("[%s] Pull request milestone cleared: #%s %s", p.Repository.FullName, titleLink, senderLink) } return &SlackPayload{ |