"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "modules/notification/webhook/webhook.go" between
gitea-1.13.1.tar.gz and gitea-1.13.2.tar.gz

About: Gitea allows to set up a self-hosted code hosting Git service (a fork of Gogs).

webhook.go  (gitea-1.13.1):webhook.go  (gitea-1.13.2)
skipping to change at line 252 skipping to change at line 252
} else { } else {
apiIssue.Action = api.HookIssueReOpened apiIssue.Action = api.HookIssueReOpened
} }
err = webhook_module.PrepareWebhooks(issue.Repo, models.HookEvent Issues, apiIssue) err = webhook_module.PrepareWebhooks(issue.Repo, models.HookEvent Issues, apiIssue)
} }
if err != nil { if err != nil {
log.Error("PrepareWebhooks [is_pull: %v, is_closed: %v]: %v", iss ue.IsPull, isClosed, err) log.Error("PrepareWebhooks [is_pull: %v, is_closed: %v]: %v", iss ue.IsPull, isClosed, err)
} }
} }
func (m *webhookNotifier) NotifyNewIssue(issue *models.Issue) { func (m *webhookNotifier) NotifyNewIssue(issue *models.Issue, mentions []*models .User) {
if err := issue.LoadRepo(); err != nil { if err := issue.LoadRepo(); err != nil {
log.Error("issue.LoadRepo: %v", err) log.Error("issue.LoadRepo: %v", err)
return return
} }
if err := issue.LoadPoster(); err != nil { if err := issue.LoadPoster(); err != nil {
log.Error("issue.LoadPoster: %v", err) log.Error("issue.LoadPoster: %v", err)
return return
} }
mode, _ := models.AccessLevel(issue.Poster, issue.Repo) mode, _ := models.AccessLevel(issue.Poster, issue.Repo)
skipping to change at line 274 skipping to change at line 274
Action: api.HookIssueOpened, Action: api.HookIssueOpened,
Index: issue.Index, Index: issue.Index,
Issue: convert.ToAPIIssue(issue), Issue: convert.ToAPIIssue(issue),
Repository: issue.Repo.APIFormat(mode), Repository: issue.Repo.APIFormat(mode),
Sender: issue.Poster.APIFormat(), Sender: issue.Poster.APIFormat(),
}); err != nil { }); err != nil {
log.Error("PrepareWebhooks: %v", err) log.Error("PrepareWebhooks: %v", err)
} }
} }
func (m *webhookNotifier) NotifyNewPullRequest(pull *models.PullRequest) { func (m *webhookNotifier) NotifyNewPullRequest(pull *models.PullRequest, mention s []*models.User) {
if err := pull.LoadIssue(); err != nil { if err := pull.LoadIssue(); err != nil {
log.Error("pull.LoadIssue: %v", err) log.Error("pull.LoadIssue: %v", err)
return return
} }
if err := pull.Issue.LoadRepo(); err != nil { if err := pull.Issue.LoadRepo(); err != nil {
log.Error("pull.Issue.LoadRepo: %v", err) log.Error("pull.Issue.LoadRepo: %v", err)
return return
} }
if err := pull.Issue.LoadPoster(); err != nil { if err := pull.Issue.LoadPoster(); err != nil {
log.Error("pull.Issue.LoadPoster: %v", err) log.Error("pull.Issue.LoadPoster: %v", err)
skipping to change at line 390 skipping to change at line 390
IsPull: false, IsPull: false,
}) })
} }
if err != nil { if err != nil {
log.Error("PrepareWebhooks [comment_id: %d]: %v", c.ID, err) log.Error("PrepareWebhooks [comment_id: %d]: %v", c.ID, err)
} }
} }
func (m *webhookNotifier) NotifyCreateIssueComment(doer *models.User, repo *mode ls.Repository, func (m *webhookNotifier) NotifyCreateIssueComment(doer *models.User, repo *mode ls.Repository,
issue *models.Issue, comment *models.Comment) { issue *models.Issue, comment *models.Comment, mentions []*models.User) {
mode, _ := models.AccessLevel(doer, repo) mode, _ := models.AccessLevel(doer, repo)
var err error var err error
if issue.IsPull { if issue.IsPull {
err = webhook_module.PrepareWebhooks(issue.Repo, models.HookEvent PullRequestComment, &api.IssueCommentPayload{ err = webhook_module.PrepareWebhooks(issue.Repo, models.HookEvent PullRequestComment, &api.IssueCommentPayload{
Action: api.HookIssueCommentCreated, Action: api.HookIssueCommentCreated,
Issue: convert.ToAPIIssue(issue), Issue: convert.ToAPIIssue(issue),
Comment: comment.APIFormat(), Comment: comment.APIFormat(),
Repository: repo.APIFormat(mode), Repository: repo.APIFormat(mode),
Sender: doer.APIFormat(), Sender: doer.APIFormat(),
skipping to change at line 642 skipping to change at line 642
PullRequest: convert.ToAPIPullRequest(issue.PullRequest), PullRequest: convert.ToAPIPullRequest(issue.PullRequest),
Repository: issue.Repo.APIFormat(mode), Repository: issue.Repo.APIFormat(mode),
Sender: doer.APIFormat(), Sender: doer.APIFormat(),
}) })
if err != nil { if err != nil {
log.Error("PrepareWebhooks [is_pull: %v]: %v", issue.IsPull, err) log.Error("PrepareWebhooks [is_pull: %v]: %v", issue.IsPull, err)
} }
} }
func (m *webhookNotifier) NotifyPullRequestReview(pr *models.PullRequest, review *models.Review, comment *models.Comment) { func (m *webhookNotifier) NotifyPullRequestReview(pr *models.PullRequest, review *models.Review, comment *models.Comment, mentions []*models.User) {
var reviewHookType models.HookEventType var reviewHookType models.HookEventType
switch review.Type { switch review.Type {
case models.ReviewTypeApprove: case models.ReviewTypeApprove:
reviewHookType = models.HookEventPullRequestReviewApproved reviewHookType = models.HookEventPullRequestReviewApproved
case models.ReviewTypeComment: case models.ReviewTypeComment:
reviewHookType = models.HookEventPullRequestComment reviewHookType = models.HookEventPullRequestComment
case models.ReviewTypeReject: case models.ReviewTypeReject:
reviewHookType = models.HookEventPullRequestReviewRejected reviewHookType = models.HookEventPullRequestReviewRejected
default: default:
 End of changes. 4 change blocks. 
4 lines changed or deleted 4 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)