diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-11-02 06:51:22 +0800 |
---|---|---|
committer | zeripath <art27@cantab.net> | 2019-11-01 22:51:22 +0000 |
commit | 0e7f7df3cf176640c66ddf286ec052c7c13beb8a (patch) | |
tree | 16afa02dd0b3df428aa7d9daadd4796eef907332 /services/issue/label.go | |
parent | ba336f6f456835f1f327ee967991079dd220266d (diff) | |
download | gitea-0e7f7df3cf176640c66ddf286ec052c7c13beb8a.tar.gz gitea-0e7f7df3cf176640c66ddf286ec052c7c13beb8a.zip |
Move webhook to a standalone package under modules (#8747)
* Move webhook to a standalone package under modules
* fix test
* fix comments
Diffstat (limited to 'services/issue/label.go')
-rw-r--r-- | services/issue/label.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/services/issue/label.go b/services/issue/label.go index b393e5d38c..bb36d58492 100644 --- a/services/issue/label.go +++ b/services/issue/label.go @@ -9,6 +9,7 @@ import ( "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/notification" api "code.gitea.io/gitea/modules/structs" + "code.gitea.io/gitea/modules/webhook" ) func sendLabelUpdatedWebhook(issue *models.Issue, doer *models.User) { @@ -34,7 +35,7 @@ func sendLabelUpdatedWebhook(issue *models.Issue, doer *models.User) { log.Error("LoadIssue: %v", err) return } - err = models.PrepareWebhooks(issue.Repo, models.HookEventPullRequest, &api.PullRequestPayload{ + err = webhook.PrepareWebhooks(issue.Repo, models.HookEventPullRequest, &api.PullRequestPayload{ Action: api.HookIssueLabelUpdated, Index: issue.Index, PullRequest: issue.PullRequest.APIFormat(), @@ -42,7 +43,7 @@ func sendLabelUpdatedWebhook(issue *models.Issue, doer *models.User) { Sender: doer.APIFormat(), }) } else { - err = models.PrepareWebhooks(issue.Repo, models.HookEventIssues, &api.IssuePayload{ + err = webhook.PrepareWebhooks(issue.Repo, models.HookEventIssues, &api.IssuePayload{ Action: api.HookIssueLabelUpdated, Index: issue.Index, Issue: issue.APIFormat(), @@ -53,7 +54,7 @@ func sendLabelUpdatedWebhook(issue *models.Issue, doer *models.User) { if err != nil { log.Error("PrepareWebhooks [is_pull: %v]: %v", issue.IsPull, err) } else { - go models.HookQueue.Add(issue.RepoID) + go webhook.HookQueue.Add(issue.RepoID) } } |