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