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