MCPcopy Create free account
hub / github.com/gogs/gogs / sendLabelUpdatedWebhook

Method sendLabelUpdatedWebhook

internal/database/issue.go:241–268  ·  view source on GitHub ↗
(doer *User)

Source from the content-addressed store, hash-verified

239}
240
241func (issue *Issue) sendLabelUpdatedWebhook(doer *User) {
242 var err error
243 if issue.IsPull {
244 err = issue.PullRequest.LoadIssue()
245 if err != nil {
246 log.Error("LoadIssue: %v", err)
247 return
248 }
249 err = PrepareWebhooks(issue.Repo, HookEventTypePullRequest, &api.PullRequestPayload{
250 Action: api.HOOK_ISSUE_LABEL_UPDATED,
251 Index: issue.Index,
252 PullRequest: issue.PullRequest.APIFormat(),
253 Repository: issue.Repo.APIFormatLegacy(nil),
254 Sender: doer.APIFormat(),
255 })
256 } else {
257 err = PrepareWebhooks(issue.Repo, HookEventTypeIssues, &api.IssuesPayload{
258 Action: api.HOOK_ISSUE_LABEL_UPDATED,
259 Index: issue.Index,
260 Issue: issue.APIFormat(),
261 Repository: issue.Repo.APIFormatLegacy(nil),
262 Sender: doer.APIFormat(),
263 })
264 }
265 if err != nil {
266 log.Error("PrepareWebhooks [is_pull: %v]: %v", issue.IsPull, err)
267 }
268}
269
270func (issue *Issue) addLabel(e *xorm.Session, label *Label) error {
271 return newIssueLabel(e, issue, label)

Callers 3

AddLabelMethod · 0.95
AddLabelsMethod · 0.95
RemoveLabelMethod · 0.95

Implementers 1

mailerIssueinternal/database/issue_mail.go

Calls 5

APIFormatMethod · 0.95
PrepareWebhooksFunction · 0.85
LoadIssueMethod · 0.80
APIFormatLegacyMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected