notification.go (gitea-1.13.1) | : | notification.go (gitea-1.13.2) | ||
---|---|---|---|---|
skipping to change at line 42 | skipping to change at line 42 | |||
if setting.Service.EnableNotifyMail { | if setting.Service.EnableNotifyMail { | |||
RegisterNotifier(mail.NewNotifier()) | RegisterNotifier(mail.NewNotifier()) | |||
} | } | |||
RegisterNotifier(indexer.NewNotifier()) | RegisterNotifier(indexer.NewNotifier()) | |||
RegisterNotifier(webhook.NewNotifier()) | RegisterNotifier(webhook.NewNotifier()) | |||
RegisterNotifier(action.NewNotifier()) | RegisterNotifier(action.NewNotifier()) | |||
} | } | |||
// NotifyCreateIssueComment notifies issue comment related message to notifiers | // NotifyCreateIssueComment notifies issue comment related message to notifiers | |||
func NotifyCreateIssueComment(doer *models.User, repo *models.Repository, | func NotifyCreateIssueComment(doer *models.User, repo *models.Repository, | |||
issue *models.Issue, comment *models.Comment) { | issue *models.Issue, comment *models.Comment, mentions []*models.User) { | |||
for _, notifier := range notifiers { | for _, notifier := range notifiers { | |||
notifier.NotifyCreateIssueComment(doer, repo, issue, comment) | notifier.NotifyCreateIssueComment(doer, repo, issue, comment, men tions) | |||
} | } | |||
} | } | |||
// NotifyNewIssue notifies new issue to notifiers | // NotifyNewIssue notifies new issue to notifiers | |||
func NotifyNewIssue(issue *models.Issue) { | func NotifyNewIssue(issue *models.Issue, mentions []*models.User) { | |||
for _, notifier := range notifiers { | for _, notifier := range notifiers { | |||
notifier.NotifyNewIssue(issue) | notifier.NotifyNewIssue(issue, mentions) | |||
} | } | |||
} | } | |||
// NotifyIssueChangeStatus notifies close or reopen issue to notifiers | // NotifyIssueChangeStatus notifies close or reopen issue to notifiers | |||
func NotifyIssueChangeStatus(doer *models.User, issue *models.Issue, actionComme nt *models.Comment, closeOrReopen bool) { | func NotifyIssueChangeStatus(doer *models.User, issue *models.Issue, actionComme nt *models.Comment, closeOrReopen bool) { | |||
for _, notifier := range notifiers { | for _, notifier := range notifiers { | |||
notifier.NotifyIssueChangeStatus(doer, issue, actionComment, clos eOrReopen) | notifier.NotifyIssueChangeStatus(doer, issue, actionComment, clos eOrReopen) | |||
} | } | |||
} | } | |||
// NotifyMergePullRequest notifies merge pull request to notifiers | // NotifyMergePullRequest notifies merge pull request to notifiers | |||
func NotifyMergePullRequest(pr *models.PullRequest, doer *models.User) { | func NotifyMergePullRequest(pr *models.PullRequest, doer *models.User) { | |||
for _, notifier := range notifiers { | for _, notifier := range notifiers { | |||
notifier.NotifyMergePullRequest(pr, doer) | notifier.NotifyMergePullRequest(pr, doer) | |||
} | } | |||
} | } | |||
// NotifyNewPullRequest notifies new pull request to notifiers | // NotifyNewPullRequest notifies new pull request to notifiers | |||
func NotifyNewPullRequest(pr *models.PullRequest) { | func NotifyNewPullRequest(pr *models.PullRequest, mentions []*models.User) { | |||
for _, notifier := range notifiers { | for _, notifier := range notifiers { | |||
notifier.NotifyNewPullRequest(pr) | notifier.NotifyNewPullRequest(pr, mentions) | |||
} | } | |||
} | } | |||
// NotifyPullRequestSynchronized notifies Synchronized pull request | // NotifyPullRequestSynchronized notifies Synchronized pull request | |||
func NotifyPullRequestSynchronized(doer *models.User, pr *models.PullRequest) { | func NotifyPullRequestSynchronized(doer *models.User, pr *models.PullRequest) { | |||
for _, notifier := range notifiers { | for _, notifier := range notifiers { | |||
notifier.NotifyPullRequestSynchronized(doer, pr) | notifier.NotifyPullRequestSynchronized(doer, pr) | |||
} | } | |||
} | } | |||
// NotifyPullRequestReview notifies new pull request review | // NotifyPullRequestReview notifies new pull request review | |||
func NotifyPullRequestReview(pr *models.PullRequest, review *models.Review, comm ent *models.Comment) { | func NotifyPullRequestReview(pr *models.PullRequest, review *models.Review, comm ent *models.Comment, mentions []*models.User) { | |||
for _, notifier := range notifiers { | for _, notifier := range notifiers { | |||
notifier.NotifyPullRequestReview(pr, review, comment) | notifier.NotifyPullRequestReview(pr, review, comment, mentions) | |||
} | ||||
} | ||||
// NotifyPullRequestCodeComment notifies new pull request code comment | ||||
func NotifyPullRequestCodeComment(pr *models.PullRequest, comment *models.Commen | ||||
t, mentions []*models.User) { | ||||
for _, notifier := range notifiers { | ||||
notifier.NotifyPullRequestCodeComment(pr, comment, mentions) | ||||
} | } | |||
} | } | |||
// NotifyPullRequestChangeTargetBranch notifies when a pull request's target bra nch was changed | // NotifyPullRequestChangeTargetBranch notifies when a pull request's target bra nch was changed | |||
func NotifyPullRequestChangeTargetBranch(doer *models.User, pr *models.PullReque st, oldBranch string) { | func NotifyPullRequestChangeTargetBranch(doer *models.User, pr *models.PullReque st, oldBranch string) { | |||
for _, notifier := range notifiers { | for _, notifier := range notifiers { | |||
notifier.NotifyPullRequestChangeTargetBranch(doer, pr, oldBranch) | notifier.NotifyPullRequestChangeTargetBranch(doer, pr, oldBranch) | |||
} | } | |||
} | } | |||
End of changes. 8 change blocks. | ||||
8 lines changed or deleted | 16 lines changed or added |