2019-01-13 22:42:55 +08:00
|
|
|
// 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 (
|
2022-06-13 17:37:59 +08:00
|
|
|
issues_model "code.gitea.io/gitea/models/issues"
|
2022-03-30 16:42:47 +08:00
|
|
|
packages_model "code.gitea.io/gitea/models/packages"
|
2021-12-10 09:27:50 +08:00
|
|
|
repo_model "code.gitea.io/gitea/models/repo"
|
2021-11-24 17:49:20 +08:00
|
|
|
user_model "code.gitea.io/gitea/models/user"
|
2020-01-10 17:34:21 +08:00
|
|
|
"code.gitea.io/gitea/modules/repository"
|
2019-01-13 22:42:55 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
// NullNotifier implements a blank notifier
|
2022-01-21 01:46:10 +08:00
|
|
|
type NullNotifier struct{}
|
2019-01-13 22:42:55 +08:00
|
|
|
|
2022-01-21 01:46:10 +08:00
|
|
|
var _ Notifier = &NullNotifier{}
|
2019-01-13 22:42:55 +08:00
|
|
|
|
|
|
|
// Run places a place holder function
|
|
|
|
func (*NullNotifier) Run() {
|
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyCreateIssueComment places a place holder function
|
2021-12-10 09:27:50 +08:00
|
|
|
func (*NullNotifier) NotifyCreateIssueComment(doer *user_model.User, repo *repo_model.Repository,
|
2022-06-13 17:37:59 +08:00
|
|
|
issue *issues_model.Issue, comment *issues_model.Comment, mentions []*user_model.User) {
|
2019-01-13 22:42:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyNewIssue places a place holder function
|
2022-06-13 17:37:59 +08:00
|
|
|
func (*NullNotifier) NotifyNewIssue(issue *issues_model.Issue, mentions []*user_model.User) {
|
2019-01-13 22:42:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyIssueChangeStatus places a place holder function
|
2022-06-13 17:37:59 +08:00
|
|
|
func (*NullNotifier) NotifyIssueChangeStatus(doer *user_model.User, issue *issues_model.Issue, actionComment *issues_model.Comment, isClosed bool) {
|
2019-01-13 22:42:55 +08:00
|
|
|
}
|
|
|
|
|
2022-03-01 08:20:15 +08:00
|
|
|
// NotifyDeleteIssue notify when some issue deleted
|
2022-06-13 17:37:59 +08:00
|
|
|
func (*NullNotifier) NotifyDeleteIssue(doer *user_model.User, issue *issues_model.Issue) {
|
2022-03-01 08:20:15 +08:00
|
|
|
}
|
|
|
|
|
2019-01-13 22:42:55 +08:00
|
|
|
// NotifyNewPullRequest places a place holder function
|
2022-06-13 17:37:59 +08:00
|
|
|
func (*NullNotifier) NotifyNewPullRequest(pr *issues_model.PullRequest, mentions []*user_model.User) {
|
2019-01-13 22:42:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyPullRequestReview places a place holder function
|
2022-06-13 17:37:59 +08:00
|
|
|
func (*NullNotifier) NotifyPullRequestReview(pr *issues_model.PullRequest, r *issues_model.Review, comment *issues_model.Comment, mentions []*user_model.User) {
|
2021-01-03 01:04:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyPullRequestCodeComment places a place holder function
|
2022-06-13 17:37:59 +08:00
|
|
|
func (*NullNotifier) NotifyPullRequestCodeComment(pr *issues_model.PullRequest, comment *issues_model.Comment, mentions []*user_model.User) {
|
2019-01-13 22:42:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyMergePullRequest places a place holder function
|
2022-06-13 17:37:59 +08:00
|
|
|
func (*NullNotifier) NotifyMergePullRequest(pr *issues_model.PullRequest, doer *user_model.User) {
|
2019-01-13 22:42:55 +08:00
|
|
|
}
|
|
|
|
|
2022-11-03 23:49:00 +08:00
|
|
|
// NotifyAutoMergePullRequest places a place holder function
|
|
|
|
func (*NullNotifier) NotifyAutoMergePullRequest(pr *issues_model.PullRequest, doer *user_model.User) {
|
|
|
|
}
|
|
|
|
|
2019-11-05 19:04:08 +08:00
|
|
|
// NotifyPullRequestSynchronized places a place holder function
|
2022-06-13 17:37:59 +08:00
|
|
|
func (*NullNotifier) NotifyPullRequestSynchronized(doer *user_model.User, pr *issues_model.PullRequest) {
|
2019-11-05 19:04:08 +08:00
|
|
|
}
|
|
|
|
|
2019-12-16 14:20:25 +08:00
|
|
|
// NotifyPullRequestChangeTargetBranch places a place holder function
|
2022-06-13 17:37:59 +08:00
|
|
|
func (*NullNotifier) NotifyPullRequestChangeTargetBranch(doer *user_model.User, pr *issues_model.PullRequest, oldBranch string) {
|
2019-12-16 14:20:25 +08:00
|
|
|
}
|
|
|
|
|
2020-05-20 20:47:24 +08:00
|
|
|
// NotifyPullRequestPushCommits notifies when push commits to pull request's head branch
|
2022-06-13 17:37:59 +08:00
|
|
|
func (*NullNotifier) NotifyPullRequestPushCommits(doer *user_model.User, pr *issues_model.PullRequest, comment *issues_model.Comment) {
|
2020-05-20 20:47:24 +08:00
|
|
|
}
|
|
|
|
|
2021-02-12 01:32:25 +08:00
|
|
|
// NotifyPullRevieweDismiss notifies when a review was dismissed by repo admin
|
2022-06-13 17:37:59 +08:00
|
|
|
func (*NullNotifier) NotifyPullRevieweDismiss(doer *user_model.User, review *issues_model.Review, comment *issues_model.Comment) {
|
2021-02-12 01:32:25 +08:00
|
|
|
}
|
|
|
|
|
2019-01-13 22:42:55 +08:00
|
|
|
// NotifyUpdateComment places a place holder function
|
2022-06-13 17:37:59 +08:00
|
|
|
func (*NullNotifier) NotifyUpdateComment(doer *user_model.User, c *issues_model.Comment, oldContent string) {
|
2019-01-13 22:42:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyDeleteComment places a place holder function
|
2022-06-13 17:37:59 +08:00
|
|
|
func (*NullNotifier) NotifyDeleteComment(doer *user_model.User, c *issues_model.Comment) {
|
2019-01-13 22:42:55 +08:00
|
|
|
}
|
|
|
|
|
2022-09-05 03:54:23 +08:00
|
|
|
// NotifyNewWikiPage places a place holder function
|
|
|
|
func (*NullNotifier) NotifyNewWikiPage(doer *user_model.User, repo *repo_model.Repository, page, comment string) {
|
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyEditWikiPage places a place holder function
|
|
|
|
func (*NullNotifier) NotifyEditWikiPage(doer *user_model.User, repo *repo_model.Repository, page, comment string) {
|
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyDeleteWikiPage places a place holder function
|
|
|
|
func (*NullNotifier) NotifyDeleteWikiPage(doer *user_model.User, repo *repo_model.Repository, page string) {
|
|
|
|
}
|
|
|
|
|
2019-01-13 22:42:55 +08:00
|
|
|
// NotifyNewRelease places a place holder function
|
2022-08-25 10:31:57 +08:00
|
|
|
func (*NullNotifier) NotifyNewRelease(rel *repo_model.Release) {
|
2019-01-13 22:42:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyUpdateRelease places a place holder function
|
2022-08-25 10:31:57 +08:00
|
|
|
func (*NullNotifier) NotifyUpdateRelease(doer *user_model.User, rel *repo_model.Release) {
|
2019-01-13 22:42:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyDeleteRelease places a place holder function
|
2022-08-25 10:31:57 +08:00
|
|
|
func (*NullNotifier) NotifyDeleteRelease(doer *user_model.User, rel *repo_model.Release) {
|
2019-01-13 22:42:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyIssueChangeMilestone places a place holder function
|
2022-06-13 17:37:59 +08:00
|
|
|
func (*NullNotifier) NotifyIssueChangeMilestone(doer *user_model.User, issue *issues_model.Issue, oldMilestoneID int64) {
|
2019-01-13 22:42:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyIssueChangeContent places a place holder function
|
2022-06-13 17:37:59 +08:00
|
|
|
func (*NullNotifier) NotifyIssueChangeContent(doer *user_model.User, issue *issues_model.Issue, oldContent string) {
|
2019-01-13 22:42:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyIssueChangeAssignee places a place holder function
|
2022-06-13 17:37:59 +08:00
|
|
|
func (*NullNotifier) NotifyIssueChangeAssignee(doer *user_model.User, issue *issues_model.Issue, assignee *user_model.User, removed bool, comment *issues_model.Comment) {
|
2019-01-13 22:42:55 +08:00
|
|
|
}
|
|
|
|
|
2020-05-01 04:24:08 +08:00
|
|
|
// NotifyPullReviewRequest places a place holder function
|
2022-06-13 17:37:59 +08:00
|
|
|
func (*NullNotifier) NotifyPullReviewRequest(doer *user_model.User, issue *issues_model.Issue, reviewer *user_model.User, isRequest bool, comment *issues_model.Comment) {
|
2020-04-07 00:33:34 +08:00
|
|
|
}
|
|
|
|
|
2019-01-13 22:42:55 +08:00
|
|
|
// NotifyIssueClearLabels places a place holder function
|
2022-06-13 17:37:59 +08:00
|
|
|
func (*NullNotifier) NotifyIssueClearLabels(doer *user_model.User, issue *issues_model.Issue) {
|
2019-01-13 22:42:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyIssueChangeTitle places a place holder function
|
2022-06-13 17:37:59 +08:00
|
|
|
func (*NullNotifier) NotifyIssueChangeTitle(doer *user_model.User, issue *issues_model.Issue, oldTitle string) {
|
2019-01-13 22:42:55 +08:00
|
|
|
}
|
|
|
|
|
2020-09-09 00:29:51 +08:00
|
|
|
// NotifyIssueChangeRef places a place holder function
|
2022-06-13 17:37:59 +08:00
|
|
|
func (*NullNotifier) NotifyIssueChangeRef(doer *user_model.User, issue *issues_model.Issue, oldTitle string) {
|
2020-09-09 00:29:51 +08:00
|
|
|
}
|
|
|
|
|
2019-01-13 22:42:55 +08:00
|
|
|
// NotifyIssueChangeLabels places a place holder function
|
2022-06-13 17:37:59 +08:00
|
|
|
func (*NullNotifier) NotifyIssueChangeLabels(doer *user_model.User, issue *issues_model.Issue,
|
|
|
|
addedLabels, removedLabels []*issues_model.Label) {
|
2019-01-13 22:42:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyCreateRepository places a place holder function
|
2021-12-20 12:41:31 +08:00
|
|
|
func (*NullNotifier) NotifyCreateRepository(doer, u *user_model.User, repo *repo_model.Repository) {
|
2019-01-13 22:42:55 +08:00
|
|
|
}
|
|
|
|
|
2019-11-15 16:06:11 +08:00
|
|
|
// NotifyDeleteRepository places a place holder function
|
2021-12-10 09:27:50 +08:00
|
|
|
func (*NullNotifier) NotifyDeleteRepository(doer *user_model.User, repo *repo_model.Repository) {
|
2019-11-15 16:06:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyForkRepository places a place holder function
|
2021-12-10 09:27:50 +08:00
|
|
|
func (*NullNotifier) NotifyForkRepository(doer *user_model.User, oldRepo, repo *repo_model.Repository) {
|
2019-11-15 16:06:11 +08:00
|
|
|
}
|
|
|
|
|
2019-01-13 22:42:55 +08:00
|
|
|
// NotifyMigrateRepository places a place holder function
|
2021-12-20 12:41:31 +08:00
|
|
|
func (*NullNotifier) NotifyMigrateRepository(doer, u *user_model.User, repo *repo_model.Repository) {
|
2019-01-13 22:42:55 +08:00
|
|
|
}
|
2019-11-03 14:59:26 +08:00
|
|
|
|
|
|
|
// NotifyPushCommits notifies commits pushed to notifiers
|
2021-12-10 09:27:50 +08:00
|
|
|
func (*NullNotifier) NotifyPushCommits(pusher *user_model.User, repo *repo_model.Repository, opts *repository.PushUpdateOptions, commits *repository.PushCommits) {
|
2019-11-03 14:59:26 +08:00
|
|
|
}
|
2019-11-06 14:43:03 +08:00
|
|
|
|
|
|
|
// NotifyCreateRef notifies branch or tag creation to notifiers
|
2022-01-20 07:26:57 +08:00
|
|
|
func (*NullNotifier) NotifyCreateRef(doer *user_model.User, repo *repo_model.Repository, refType, refFullName, refID string) {
|
2019-11-06 14:43:03 +08:00
|
|
|
}
|
|
|
|
|
2021-07-08 19:38:13 +08:00
|
|
|
// NotifyDeleteRef notifies branch or tag deletion to notifiers
|
2021-12-10 09:27:50 +08:00
|
|
|
func (*NullNotifier) NotifyDeleteRef(doer *user_model.User, repo *repo_model.Repository, refType, refFullName string) {
|
2019-11-06 14:43:03 +08:00
|
|
|
}
|
2019-11-15 16:06:11 +08:00
|
|
|
|
|
|
|
// NotifyRenameRepository places a place holder function
|
2021-12-10 09:27:50 +08:00
|
|
|
func (*NullNotifier) NotifyRenameRepository(doer *user_model.User, repo *repo_model.Repository, oldRepoName string) {
|
2019-11-15 16:06:11 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyTransferRepository places a place holder function
|
2021-12-10 09:27:50 +08:00
|
|
|
func (*NullNotifier) NotifyTransferRepository(doer *user_model.User, repo *repo_model.Repository, oldOwnerName string) {
|
2019-11-15 16:06:11 +08:00
|
|
|
}
|
2019-11-24 13:16:59 +08:00
|
|
|
|
|
|
|
// NotifySyncPushCommits places a place holder function
|
2021-12-10 09:27:50 +08:00
|
|
|
func (*NullNotifier) NotifySyncPushCommits(pusher *user_model.User, repo *repo_model.Repository, opts *repository.PushUpdateOptions, commits *repository.PushCommits) {
|
2019-11-24 13:16:59 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// NotifySyncCreateRef places a place holder function
|
2022-01-20 07:26:57 +08:00
|
|
|
func (*NullNotifier) NotifySyncCreateRef(doer *user_model.User, repo *repo_model.Repository, refType, refFullName, refID string) {
|
2019-11-24 13:16:59 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// NotifySyncDeleteRef places a place holder function
|
2021-12-10 09:27:50 +08:00
|
|
|
func (*NullNotifier) NotifySyncDeleteRef(doer *user_model.User, repo *repo_model.Repository, refType, refFullName string) {
|
2019-11-24 13:16:59 +08:00
|
|
|
}
|
2021-03-01 08:47:30 +08:00
|
|
|
|
|
|
|
// NotifyRepoPendingTransfer places a place holder function
|
2021-12-10 09:27:50 +08:00
|
|
|
func (*NullNotifier) NotifyRepoPendingTransfer(doer, newOwner *user_model.User, repo *repo_model.Repository) {
|
2021-03-01 08:47:30 +08:00
|
|
|
}
|
2022-03-30 16:42:47 +08:00
|
|
|
|
|
|
|
// NotifyPackageCreate places a place holder function
|
|
|
|
func (*NullNotifier) NotifyPackageCreate(doer *user_model.User, pd *packages_model.PackageDescriptor) {
|
|
|
|
}
|
|
|
|
|
|
|
|
// NotifyPackageDelete places a place holder function
|
|
|
|
func (*NullNotifier) NotifyPackageDelete(doer *user_model.User, pd *packages_model.PackageDescriptor) {
|
|
|
|
}
|