]> source.dussan.org Git - gitea.git/commitdiff
label and milestone webhooks on issue/pull creation (#14363)
authorJimmy Praet <jimmy.praet@telenet.be>
Sun, 17 Jan 2021 14:15:57 +0000 (15:15 +0100)
committerGitHub <noreply@github.com>
Sun, 17 Jan 2021 14:15:57 +0000 (16:15 +0200)
services/issue/issue.go
services/pull/pull.go

index 14de0290a1b11c0412c0a56ee29fb41f6ec3e1db..90f689a55cc3e43e31853393ab5ea472dbcce384 100644 (file)
@@ -29,6 +29,12 @@ func NewIssue(repo *models.Repository, issue *models.Issue, labelIDs []int64, uu
        }
 
        notification.NotifyNewIssue(issue, mentions)
+       if len(issue.Labels) > 0 {
+               notification.NotifyIssueChangeLabels(issue.Poster, issue, issue.Labels, nil)
+       }
+       if issue.Milestone != nil {
+               notification.NotifyIssueChangeMilestone(issue.Poster, issue, 0)
+       }
 
        return nil
 }
index 1886448ee0093fb6eb6adf340b6fd7d50c90d0d9..92f1ff65fb2fd6289d7d2d727520e9778adf2d2c 100644 (file)
@@ -59,6 +59,12 @@ func NewPullRequest(repo *models.Repository, pull *models.Issue, labelIDs []int6
        }
 
        notification.NotifyNewPullRequest(pr, mentions)
+       if len(pull.Labels) > 0 {
+               notification.NotifyIssueChangeLabels(pull.Poster, pull, pull.Labels, nil)
+       }
+       if pull.Milestone != nil {
+               notification.NotifyIssueChangeMilestone(pull.Poster, pull, 0)
+       }
 
        // add first push codes comment
        baseGitRepo, err := git.OpenRepository(pr.BaseRepo.RepoPath())