Skip to content

Commit 49b549e

Browse files
committed
use NullNotifier as parent struct
1 parent 34fb9ac commit 49b549e

File tree

1 file changed

+2
-46
lines changed

1 file changed

+2
-46
lines changed
Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
// Copyright 2018 The Gitea Authors. All rights reserved.
1+
// Copyright 2019 The Gitea Authors. All rights reserved.
22
// Use of this source code is governed by a MIT-style
33
// license that can be found in the LICENSE file.
44

55
package indexer
66

77
import (
8-
"code.gitea.io/git"
98
"code.gitea.io/gitea/models"
109
"code.gitea.io/gitea/modules/notification/base"
1110
)
1211

1312
type indexerNotifier struct {
13+
base.NullNotifier
1414
}
1515

1616
var (
@@ -22,9 +22,6 @@ func NewNotifier() base.Notifier {
2222
return &indexerNotifier{}
2323
}
2424

25-
func (r *indexerNotifier) Run() {
26-
}
27-
2825
func (r *indexerNotifier) NotifyCreateIssueComment(doer *models.User, repo *models.Repository,
2926
issue *models.Issue, comment *models.Comment) {
3027
if comment.Type == models.CommentTypeComment {
@@ -36,19 +33,10 @@ func (r *indexerNotifier) NotifyNewIssue(issue *models.Issue) {
3633
models.UpdateIssueIndexer(issue.ID)
3734
}
3835

39-
func (r *indexerNotifier) NotifyIssueChangeStatus(doer *models.User, issue *models.Issue, isClosed bool) {
40-
}
41-
4236
func (r *indexerNotifier) NotifyNewPullRequest(pr *models.PullRequest) {
4337
models.UpdateIssueIndexer(pr.Issue.ID)
4438
}
4539

46-
func (r *indexerNotifier) NotifyMergePullRequest(pr *models.PullRequest, doer *models.User, baseRepo *git.Repository) {
47-
}
48-
49-
func (r *indexerNotifier) NotifyPullRequestReview(*models.PullRequest, *models.Review, *models.Comment) {
50-
}
51-
5240
func (r *indexerNotifier) NotifyUpdateComment(doer *models.User, c *models.Comment, oldContent string) {
5341
if c.Type == models.CommentTypeComment {
5442
models.UpdateIssueIndexer(c.IssueID)
@@ -65,42 +53,10 @@ func (r *indexerNotifier) NotifyDeleteRepository(doer *models.User, repo *models
6553
models.DeleteRepoFromIndexer(repo)
6654
}
6755

68-
func (r *indexerNotifier) NotifyForkRepository(doer *models.User, oldRepo, repo *models.Repository) {
69-
70-
}
71-
72-
func (r *indexerNotifier) NotifyNewRelease(rel *models.Release) {
73-
}
74-
75-
func (r *indexerNotifier) NotifyUpdateRelease(doer *models.User, rel *models.Release) {
76-
}
77-
78-
func (r *indexerNotifier) NotifyDeleteRelease(doer *models.User, rel *models.Release) {
79-
}
80-
81-
func (r *indexerNotifier) NotifyIssueChangeMilestone(doer *models.User, issue *models.Issue) {
82-
}
83-
8456
func (r *indexerNotifier) NotifyIssueChangeContent(doer *models.User, issue *models.Issue, oldContent string) {
8557
models.UpdateIssueIndexer(issue.ID)
8658
}
8759

88-
func (r *indexerNotifier) NotifyIssueChangeAssignee(doer *models.User, issue *models.Issue, removed bool) {
89-
}
90-
91-
func (r *indexerNotifier) NotifyIssueClearLabels(doer *models.User, issue *models.Issue) {
92-
}
93-
9460
func (r *indexerNotifier) NotifyIssueChangeTitle(doer *models.User, issue *models.Issue, oldTitle string) {
9561
models.UpdateIssueIndexer(issue.ID)
9662
}
97-
98-
func (r *indexerNotifier) NotifyIssueChangeLabels(doer *models.User, issue *models.Issue,
99-
addedLabels []*models.Label, removedLabels []*models.Label) {
100-
}
101-
102-
func (r *indexerNotifier) NotifyCreateRepository(doer *models.User, u *models.User, repo *models.Repository) {
103-
}
104-
105-
func (r *indexerNotifier) NotifyMigrateRepository(doer *models.User, u *models.User, repo *models.Repository) {
106-
}

0 commit comments

Comments
 (0)