|
@@ -236,7 +236,7 @@ func (issue *Issue) sendLabelUpdatedWebhook(doer *User) {
|
|
|
log.Error(2, "LoadIssue: %v", err)
|
|
log.Error(2, "LoadIssue: %v", err)
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
- err = PrepareWebhooks(issue.Repo, HOOK_EVENT_PULL_REQUEST, &api.PullRequestPayload{
|
|
|
|
|
|
|
+ err = PrepareWebhooks(issue.Repo, HookEventPullRequest, &api.PullRequestPayload{
|
|
|
Action: api.HOOK_ISSUE_LABEL_UPDATED,
|
|
Action: api.HOOK_ISSUE_LABEL_UPDATED,
|
|
|
Index: issue.Index,
|
|
Index: issue.Index,
|
|
|
PullRequest: issue.PullRequest.APIFormat(),
|
|
PullRequest: issue.PullRequest.APIFormat(),
|
|
@@ -244,7 +244,7 @@ func (issue *Issue) sendLabelUpdatedWebhook(doer *User) {
|
|
|
Sender: doer.APIFormat(),
|
|
Sender: doer.APIFormat(),
|
|
|
})
|
|
})
|
|
|
} else {
|
|
} else {
|
|
|
- err = PrepareWebhooks(issue.Repo, HOOK_EVENT_ISSUES, &api.IssuesPayload{
|
|
|
|
|
|
|
+ err = PrepareWebhooks(issue.Repo, HookEventIssues, &api.IssuesPayload{
|
|
|
Action: api.HOOK_ISSUE_LABEL_UPDATED,
|
|
Action: api.HOOK_ISSUE_LABEL_UPDATED,
|
|
|
Index: issue.Index,
|
|
Index: issue.Index,
|
|
|
Issue: issue.APIFormat(),
|
|
Issue: issue.APIFormat(),
|
|
@@ -353,7 +353,7 @@ func (issue *Issue) ClearLabels(doer *User) (err error) {
|
|
|
log.Error(2, "LoadIssue: %v", err)
|
|
log.Error(2, "LoadIssue: %v", err)
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
- err = PrepareWebhooks(issue.Repo, HOOK_EVENT_PULL_REQUEST, &api.PullRequestPayload{
|
|
|
|
|
|
|
+ err = PrepareWebhooks(issue.Repo, HookEventPullRequest, &api.PullRequestPayload{
|
|
|
Action: api.HOOK_ISSUE_LABEL_CLEARED,
|
|
Action: api.HOOK_ISSUE_LABEL_CLEARED,
|
|
|
Index: issue.Index,
|
|
Index: issue.Index,
|
|
|
PullRequest: issue.PullRequest.APIFormat(),
|
|
PullRequest: issue.PullRequest.APIFormat(),
|
|
@@ -361,7 +361,7 @@ func (issue *Issue) ClearLabels(doer *User) (err error) {
|
|
|
Sender: doer.APIFormat(),
|
|
Sender: doer.APIFormat(),
|
|
|
})
|
|
})
|
|
|
} else {
|
|
} else {
|
|
|
- err = PrepareWebhooks(issue.Repo, HOOK_EVENT_ISSUES, &api.IssuesPayload{
|
|
|
|
|
|
|
+ err = PrepareWebhooks(issue.Repo, HookEventIssues, &api.IssuesPayload{
|
|
|
Action: api.HOOK_ISSUE_LABEL_CLEARED,
|
|
Action: api.HOOK_ISSUE_LABEL_CLEARED,
|
|
|
Index: issue.Index,
|
|
Index: issue.Index,
|
|
|
Issue: issue.APIFormat(),
|
|
Issue: issue.APIFormat(),
|
|
@@ -492,7 +492,7 @@ func (issue *Issue) ChangeStatus(doer *User, repo *Repository, isClosed bool) (e
|
|
|
} else {
|
|
} else {
|
|
|
apiPullRequest.Action = api.HOOK_ISSUE_REOPENED
|
|
apiPullRequest.Action = api.HOOK_ISSUE_REOPENED
|
|
|
}
|
|
}
|
|
|
- err = PrepareWebhooks(repo, HOOK_EVENT_PULL_REQUEST, apiPullRequest)
|
|
|
|
|
|
|
+ err = PrepareWebhooks(repo, HookEventPullRequest, apiPullRequest)
|
|
|
} else {
|
|
} else {
|
|
|
apiIssues := &api.IssuesPayload{
|
|
apiIssues := &api.IssuesPayload{
|
|
|
Index: issue.Index,
|
|
Index: issue.Index,
|
|
@@ -505,7 +505,7 @@ func (issue *Issue) ChangeStatus(doer *User, repo *Repository, isClosed bool) (e
|
|
|
} else {
|
|
} else {
|
|
|
apiIssues.Action = api.HOOK_ISSUE_REOPENED
|
|
apiIssues.Action = api.HOOK_ISSUE_REOPENED
|
|
|
}
|
|
}
|
|
|
- err = PrepareWebhooks(repo, HOOK_EVENT_ISSUES, apiIssues)
|
|
|
|
|
|
|
+ err = PrepareWebhooks(repo, HookEventIssues, apiIssues)
|
|
|
}
|
|
}
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
raven.CaptureErrorAndWait(err, nil)
|
|
raven.CaptureErrorAndWait(err, nil)
|
|
@@ -524,7 +524,7 @@ func (issue *Issue) ChangeTitle(doer *User, title string) (err error) {
|
|
|
|
|
|
|
|
if issue.IsPull {
|
|
if issue.IsPull {
|
|
|
issue.PullRequest.Issue = issue
|
|
issue.PullRequest.Issue = issue
|
|
|
- err = PrepareWebhooks(issue.Repo, HOOK_EVENT_PULL_REQUEST, &api.PullRequestPayload{
|
|
|
|
|
|
|
+ err = PrepareWebhooks(issue.Repo, HookEventPullRequest, &api.PullRequestPayload{
|
|
|
Action: api.HOOK_ISSUE_EDITED,
|
|
Action: api.HOOK_ISSUE_EDITED,
|
|
|
Index: issue.Index,
|
|
Index: issue.Index,
|
|
|
PullRequest: issue.PullRequest.APIFormat(),
|
|
PullRequest: issue.PullRequest.APIFormat(),
|
|
@@ -537,7 +537,7 @@ func (issue *Issue) ChangeTitle(doer *User, title string) (err error) {
|
|
|
Sender: doer.APIFormat(),
|
|
Sender: doer.APIFormat(),
|
|
|
})
|
|
})
|
|
|
} else {
|
|
} else {
|
|
|
- err = PrepareWebhooks(issue.Repo, HOOK_EVENT_ISSUES, &api.IssuesPayload{
|
|
|
|
|
|
|
+ err = PrepareWebhooks(issue.Repo, HookEventIssues, &api.IssuesPayload{
|
|
|
Action: api.HOOK_ISSUE_EDITED,
|
|
Action: api.HOOK_ISSUE_EDITED,
|
|
|
Index: issue.Index,
|
|
Index: issue.Index,
|
|
|
Issue: issue.APIFormat(),
|
|
Issue: issue.APIFormat(),
|
|
@@ -567,7 +567,7 @@ func (issue *Issue) ChangeContent(doer *User, content string) (err error) {
|
|
|
|
|
|
|
|
if issue.IsPull {
|
|
if issue.IsPull {
|
|
|
issue.PullRequest.Issue = issue
|
|
issue.PullRequest.Issue = issue
|
|
|
- err = PrepareWebhooks(issue.Repo, HOOK_EVENT_PULL_REQUEST, &api.PullRequestPayload{
|
|
|
|
|
|
|
+ err = PrepareWebhooks(issue.Repo, HookEventPullRequest, &api.PullRequestPayload{
|
|
|
Action: api.HOOK_ISSUE_EDITED,
|
|
Action: api.HOOK_ISSUE_EDITED,
|
|
|
Index: issue.Index,
|
|
Index: issue.Index,
|
|
|
PullRequest: issue.PullRequest.APIFormat(),
|
|
PullRequest: issue.PullRequest.APIFormat(),
|
|
@@ -580,7 +580,7 @@ func (issue *Issue) ChangeContent(doer *User, content string) (err error) {
|
|
|
Sender: doer.APIFormat(),
|
|
Sender: doer.APIFormat(),
|
|
|
})
|
|
})
|
|
|
} else {
|
|
} else {
|
|
|
- err = PrepareWebhooks(issue.Repo, HOOK_EVENT_ISSUES, &api.IssuesPayload{
|
|
|
|
|
|
|
+ err = PrepareWebhooks(issue.Repo, HookEventIssues, &api.IssuesPayload{
|
|
|
Action: api.HOOK_ISSUE_EDITED,
|
|
Action: api.HOOK_ISSUE_EDITED,
|
|
|
Index: issue.Index,
|
|
Index: issue.Index,
|
|
|
Issue: issue.APIFormat(),
|
|
Issue: issue.APIFormat(),
|
|
@@ -629,7 +629,7 @@ func (issue *Issue) ChangeAssignee(doer *User, assigneeID int64) (err error) {
|
|
|
} else {
|
|
} else {
|
|
|
apiPullRequest.Action = api.HOOK_ISSUE_ASSIGNED
|
|
apiPullRequest.Action = api.HOOK_ISSUE_ASSIGNED
|
|
|
}
|
|
}
|
|
|
- err = PrepareWebhooks(issue.Repo, HOOK_EVENT_PULL_REQUEST, apiPullRequest)
|
|
|
|
|
|
|
+ err = PrepareWebhooks(issue.Repo, HookEventPullRequest, apiPullRequest)
|
|
|
} else {
|
|
} else {
|
|
|
apiIssues := &api.IssuesPayload{
|
|
apiIssues := &api.IssuesPayload{
|
|
|
Index: issue.Index,
|
|
Index: issue.Index,
|
|
@@ -642,7 +642,7 @@ func (issue *Issue) ChangeAssignee(doer *User, assigneeID int64) (err error) {
|
|
|
} else {
|
|
} else {
|
|
|
apiIssues.Action = api.HOOK_ISSUE_ASSIGNED
|
|
apiIssues.Action = api.HOOK_ISSUE_ASSIGNED
|
|
|
}
|
|
}
|
|
|
- err = PrepareWebhooks(issue.Repo, HOOK_EVENT_ISSUES, apiIssues)
|
|
|
|
|
|
|
+ err = PrepareWebhooks(issue.Repo, HookEventIssues, apiIssues)
|
|
|
}
|
|
}
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
raven.CaptureErrorAndWait(err, nil)
|
|
raven.CaptureErrorAndWait(err, nil)
|
|
@@ -795,7 +795,7 @@ func NewIssue(repo *Repository, issue *Issue, labelIDs []int64, uuids []string)
|
|
|
log.Error(2, "MailParticipants: %v", err)
|
|
log.Error(2, "MailParticipants: %v", err)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if err = PrepareWebhooks(repo, HOOK_EVENT_ISSUES, &api.IssuesPayload{
|
|
|
|
|
|
|
+ if err = PrepareWebhooks(repo, HookEventIssues, &api.IssuesPayload{
|
|
|
Action: api.HOOK_ISSUE_OPENED,
|
|
Action: api.HOOK_ISSUE_OPENED,
|
|
|
Index: issue.Index,
|
|
Index: issue.Index,
|
|
|
Issue: issue.APIFormat(),
|
|
Issue: issue.APIFormat(),
|