(doer *User)
| 239 | } |
| 240 | |
| 241 | func (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 | |
| 270 | func (issue *Issue) addLabel(e *xorm.Session, label *Label) error { |
| 271 | return newIssueLabel(e, issue, label) |
no test coverage detected