2019-01-13 20:12:55 +05:30
|
|
|
// Copyright 2019 The Gitea Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a MIT-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package base
|
|
|
|
|
|
|
|
import (
|
|
|
|
"code.gitea.io/gitea/models"
|
2021-12-10 06:57:50 +05:30
|
|
|
repo_model "code.gitea.io/gitea/models/repo"
|
2021-11-24 15:19:20 +05:30
|
|
|
user_model "code.gitea.io/gitea/models/user"
|
2020-01-10 15:04:21 +05:30
|
|
|
"code.gitea.io/gitea/modules/repository"
|
2019-01-13 20:12:55 +05:30
|
|
|
)
|
|
|
|
|
|
|
|
// NullNotifier implements a blank notifier
|
|
|
|
type NullNotifier struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
var (
|
|
|
|
_ Notifier = &NullNotifier{}
|
|
|
|
)
|
|
|
|
|
|
|
|
// Run places a place holder function
|
|
|
|
func (*NullNotifier) Run() {
|
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyCreateIssueComment places a place holder function
|
2021-12-10 06:57:50 +05:30
|
|
|
func (*NullNotifier) NotifyCreateIssueComment(doer *user_model.User, repo *repo_model.Repository,
|
2021-11-24 15:19:20 +05:30
|
|
|
issue *models.Issue, comment *models.Comment, mentions []*user_model.User) {
|
2019-01-13 20:12:55 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyNewIssue places a place holder function
|
2021-11-24 15:19:20 +05:30
|
|
|
func (*NullNotifier) NotifyNewIssue(issue *models.Issue, mentions []*user_model.User) {
|
2019-01-13 20:12:55 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyIssueChangeStatus places a place holder function
|
2021-11-24 15:19:20 +05:30
|
|
|
func (*NullNotifier) NotifyIssueChangeStatus(doer *user_model.User, issue *models.Issue, actionComment *models.Comment, isClosed bool) {
|
2019-01-13 20:12:55 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyNewPullRequest places a place holder function
|
2021-11-24 15:19:20 +05:30
|
|
|
func (*NullNotifier) NotifyNewPullRequest(pr *models.PullRequest, mentions []*user_model.User) {
|
2019-01-13 20:12:55 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyPullRequestReview places a place holder function
|
2021-11-24 15:19:20 +05:30
|
|
|
func (*NullNotifier) NotifyPullRequestReview(pr *models.PullRequest, r *models.Review, comment *models.Comment, mentions []*user_model.User) {
|
2021-01-02 22:34:02 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyPullRequestCodeComment places a place holder function
|
2021-11-24 15:19:20 +05:30
|
|
|
func (*NullNotifier) NotifyPullRequestCodeComment(pr *models.PullRequest, comment *models.Comment, mentions []*user_model.User) {
|
2019-01-13 20:12:55 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyMergePullRequest places a place holder function
|
2021-11-24 15:19:20 +05:30
|
|
|
func (*NullNotifier) NotifyMergePullRequest(pr *models.PullRequest, doer *user_model.User) {
|
2019-01-13 20:12:55 +05:30
|
|
|
}
|
|
|
|
|
2019-11-05 16:34:08 +05:30
|
|
|
// NotifyPullRequestSynchronized places a place holder function
|
2021-11-24 15:19:20 +05:30
|
|
|
func (*NullNotifier) NotifyPullRequestSynchronized(doer *user_model.User, pr *models.PullRequest) {
|
2019-11-05 16:34:08 +05:30
|
|
|
}
|
|
|
|
|
2019-12-16 11:50:25 +05:30
|
|
|
// NotifyPullRequestChangeTargetBranch places a place holder function
|
2021-11-24 15:19:20 +05:30
|
|
|
func (*NullNotifier) NotifyPullRequestChangeTargetBranch(doer *user_model.User, pr *models.PullRequest, oldBranch string) {
|
2019-12-16 11:50:25 +05:30
|
|
|
}
|
|
|
|
|
2020-05-20 18:17:24 +05:30
|
|
|
// NotifyPullRequestPushCommits notifies when push commits to pull request's head branch
|
2021-11-24 15:19:20 +05:30
|
|
|
func (*NullNotifier) NotifyPullRequestPushCommits(doer *user_model.User, pr *models.PullRequest, comment *models.Comment) {
|
2020-05-20 18:17:24 +05:30
|
|
|
}
|
|
|
|
|
2021-02-11 23:02:25 +05:30
|
|
|
// NotifyPullRevieweDismiss notifies when a review was dismissed by repo admin
|
2021-11-24 15:19:20 +05:30
|
|
|
func (*NullNotifier) NotifyPullRevieweDismiss(doer *user_model.User, review *models.Review, comment *models.Comment) {
|
2021-02-11 23:02:25 +05:30
|
|
|
}
|
|
|
|
|
2019-01-13 20:12:55 +05:30
|
|
|
// NotifyUpdateComment places a place holder function
|
2021-11-24 15:19:20 +05:30
|
|
|
func (*NullNotifier) NotifyUpdateComment(doer *user_model.User, c *models.Comment, oldContent string) {
|
2019-01-13 20:12:55 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyDeleteComment places a place holder function
|
2021-11-24 15:19:20 +05:30
|
|
|
func (*NullNotifier) NotifyDeleteComment(doer *user_model.User, c *models.Comment) {
|
2019-01-13 20:12:55 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyNewRelease places a place holder function
|
|
|
|
func (*NullNotifier) NotifyNewRelease(rel *models.Release) {
|
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyUpdateRelease places a place holder function
|
2021-11-24 15:19:20 +05:30
|
|
|
func (*NullNotifier) NotifyUpdateRelease(doer *user_model.User, rel *models.Release) {
|
2019-01-13 20:12:55 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyDeleteRelease places a place holder function
|
2021-11-24 15:19:20 +05:30
|
|
|
func (*NullNotifier) NotifyDeleteRelease(doer *user_model.User, rel *models.Release) {
|
2019-01-13 20:12:55 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyIssueChangeMilestone places a place holder function
|
2021-11-24 15:19:20 +05:30
|
|
|
func (*NullNotifier) NotifyIssueChangeMilestone(doer *user_model.User, issue *models.Issue, oldMilestoneID int64) {
|
2019-01-13 20:12:55 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyIssueChangeContent places a place holder function
|
2021-11-24 15:19:20 +05:30
|
|
|
func (*NullNotifier) NotifyIssueChangeContent(doer *user_model.User, issue *models.Issue, oldContent string) {
|
2019-01-13 20:12:55 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyIssueChangeAssignee places a place holder function
|
2021-11-24 15:19:20 +05:30
|
|
|
func (*NullNotifier) NotifyIssueChangeAssignee(doer *user_model.User, issue *models.Issue, assignee *user_model.User, removed bool, comment *models.Comment) {
|
2019-01-13 20:12:55 +05:30
|
|
|
}
|
|
|
|
|
2020-05-01 01:54:08 +05:30
|
|
|
// NotifyPullReviewRequest places a place holder function
|
2021-11-24 15:19:20 +05:30
|
|
|
func (*NullNotifier) NotifyPullReviewRequest(doer *user_model.User, issue *models.Issue, reviewer *user_model.User, isRequest bool, comment *models.Comment) {
|
2020-04-06 22:03:34 +05:30
|
|
|
}
|
|
|
|
|
2019-01-13 20:12:55 +05:30
|
|
|
// NotifyIssueClearLabels places a place holder function
|
2021-11-24 15:19:20 +05:30
|
|
|
func (*NullNotifier) NotifyIssueClearLabels(doer *user_model.User, issue *models.Issue) {
|
2019-01-13 20:12:55 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyIssueChangeTitle places a place holder function
|
2021-11-24 15:19:20 +05:30
|
|
|
func (*NullNotifier) NotifyIssueChangeTitle(doer *user_model.User, issue *models.Issue, oldTitle string) {
|
2019-01-13 20:12:55 +05:30
|
|
|
}
|
|
|
|
|
2020-09-08 21:59:51 +05:30
|
|
|
// NotifyIssueChangeRef places a place holder function
|
2021-11-24 15:19:20 +05:30
|
|
|
func (*NullNotifier) NotifyIssueChangeRef(doer *user_model.User, issue *models.Issue, oldTitle string) {
|
2020-09-08 21:59:51 +05:30
|
|
|
}
|
|
|
|
|
2019-01-13 20:12:55 +05:30
|
|
|
// NotifyIssueChangeLabels places a place holder function
|
2021-11-24 15:19:20 +05:30
|
|
|
func (*NullNotifier) NotifyIssueChangeLabels(doer *user_model.User, issue *models.Issue,
|
2019-01-13 20:12:55 +05:30
|
|
|
addedLabels []*models.Label, removedLabels []*models.Label) {
|
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyCreateRepository places a place holder function
|
2021-12-20 10:11:31 +05:30
|
|
|
func (*NullNotifier) NotifyCreateRepository(doer, u *user_model.User, repo *repo_model.Repository) {
|
2019-01-13 20:12:55 +05:30
|
|
|
}
|
|
|
|
|
2019-11-15 13:36:11 +05:30
|
|
|
// NotifyDeleteRepository places a place holder function
|
2021-12-10 06:57:50 +05:30
|
|
|
func (*NullNotifier) NotifyDeleteRepository(doer *user_model.User, repo *repo_model.Repository) {
|
2019-11-15 13:36:11 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyForkRepository places a place holder function
|
2021-12-10 06:57:50 +05:30
|
|
|
func (*NullNotifier) NotifyForkRepository(doer *user_model.User, oldRepo, repo *repo_model.Repository) {
|
2019-11-15 13:36:11 +05:30
|
|
|
}
|
|
|
|
|
2019-01-13 20:12:55 +05:30
|
|
|
// NotifyMigrateRepository places a place holder function
|
2021-12-20 10:11:31 +05:30
|
|
|
func (*NullNotifier) NotifyMigrateRepository(doer, u *user_model.User, repo *repo_model.Repository) {
|
2019-01-13 20:12:55 +05:30
|
|
|
}
|
2019-11-03 12:29:26 +05:30
|
|
|
|
|
|
|
// NotifyPushCommits notifies commits pushed to notifiers
|
2021-12-10 06:57:50 +05:30
|
|
|
func (*NullNotifier) NotifyPushCommits(pusher *user_model.User, repo *repo_model.Repository, opts *repository.PushUpdateOptions, commits *repository.PushCommits) {
|
2019-11-03 12:29:26 +05:30
|
|
|
}
|
2019-11-06 12:13:03 +05:30
|
|
|
|
|
|
|
// NotifyCreateRef notifies branch or tag creation to notifiers
|
2021-12-10 06:57:50 +05:30
|
|
|
func (*NullNotifier) NotifyCreateRef(doer *user_model.User, repo *repo_model.Repository, refType, refFullName string) {
|
2019-11-06 12:13:03 +05:30
|
|
|
}
|
|
|
|
|
2021-07-08 17:08:13 +05:30
|
|
|
// NotifyDeleteRef notifies branch or tag deletion to notifiers
|
2021-12-10 06:57:50 +05:30
|
|
|
func (*NullNotifier) NotifyDeleteRef(doer *user_model.User, repo *repo_model.Repository, refType, refFullName string) {
|
2019-11-06 12:13:03 +05:30
|
|
|
}
|
2019-11-15 13:36:11 +05:30
|
|
|
|
|
|
|
// NotifyRenameRepository places a place holder function
|
2021-12-10 06:57:50 +05:30
|
|
|
func (*NullNotifier) NotifyRenameRepository(doer *user_model.User, repo *repo_model.Repository, oldRepoName string) {
|
2019-11-15 13:36:11 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyTransferRepository places a place holder function
|
2021-12-10 06:57:50 +05:30
|
|
|
func (*NullNotifier) NotifyTransferRepository(doer *user_model.User, repo *repo_model.Repository, oldOwnerName string) {
|
2019-11-15 13:36:11 +05:30
|
|
|
}
|
2019-11-24 10:46:59 +05:30
|
|
|
|
|
|
|
// NotifySyncPushCommits places a place holder function
|
2021-12-10 06:57:50 +05:30
|
|
|
func (*NullNotifier) NotifySyncPushCommits(pusher *user_model.User, repo *repo_model.Repository, opts *repository.PushUpdateOptions, commits *repository.PushCommits) {
|
2019-11-24 10:46:59 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
// NotifySyncCreateRef places a place holder function
|
2021-12-10 06:57:50 +05:30
|
|
|
func (*NullNotifier) NotifySyncCreateRef(doer *user_model.User, repo *repo_model.Repository, refType, refFullName string) {
|
2019-11-24 10:46:59 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
// NotifySyncDeleteRef places a place holder function
|
2021-12-10 06:57:50 +05:30
|
|
|
func (*NullNotifier) NotifySyncDeleteRef(doer *user_model.User, repo *repo_model.Repository, refType, refFullName string) {
|
2019-11-24 10:46:59 +05:30
|
|
|
}
|
2021-03-01 06:17:30 +05:30
|
|
|
|
|
|
|
// NotifyRepoPendingTransfer places a place holder function
|
2021-12-10 06:57:50 +05:30
|
|
|
func (*NullNotifier) NotifyRepoPendingTransfer(doer, newOwner *user_model.User, repo *repo_model.Repository) {
|
2021-03-01 06:17:30 +05:30
|
|
|
}
|