diff options
author | 6543 <6543@obermui.de> | 2020-01-16 17:24:20 +0100 |
---|---|---|
committer | Antoine GIRARD <sapk@users.noreply.github.com> | 2020-01-16 17:24:20 +0100 |
commit | 06cd3e03a24e23d2d838cda6eb1edd5e7474ad42 (patch) | |
tree | 357d85714ac01f66737a26c7a4c72309989ca976 /modules/notification | |
parent | 11885daaa0397d02d7acd559234b098dfd239d49 (diff) | |
download | gitea-06cd3e03a24e23d2d838cda6eb1edd5e7474ad42.tar.gz gitea-06cd3e03a24e23d2d838cda6eb1edd5e7474ad42.zip |
[refactor] notify remove unused praram (#9804)
Diffstat (limited to 'modules/notification')
-rw-r--r-- | modules/notification/action/action.go | 3 | ||||
-rw-r--r-- | modules/notification/base/notifier.go | 3 | ||||
-rw-r--r-- | modules/notification/base/null.go | 3 | ||||
-rw-r--r-- | modules/notification/mail/mail.go | 3 | ||||
-rw-r--r-- | modules/notification/notification.go | 5 | ||||
-rw-r--r-- | modules/notification/ui/ui.go | 3 | ||||
-rw-r--r-- | modules/notification/webhook/webhook.go | 2 |
7 files changed, 8 insertions, 14 deletions
diff --git a/modules/notification/action/action.go b/modules/notification/action/action.go index 74e661c4f9..9956940f30 100644 --- a/modules/notification/action/action.go +++ b/modules/notification/action/action.go @@ -11,7 +11,6 @@ import ( "strings" "code.gitea.io/gitea/models" - "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/notification/base" "code.gitea.io/gitea/modules/repository" @@ -253,7 +252,7 @@ func (a *actionNotifier) NotifyPullRequestReview(pr *models.PullRequest, review } } -func (*actionNotifier) NotifyMergePullRequest(pr *models.PullRequest, doer *models.User, baseRepo *git.Repository) { +func (*actionNotifier) NotifyMergePullRequest(pr *models.PullRequest, doer *models.User) { if err := models.NotifyWatchers(&models.Action{ ActUserID: doer.ID, ActUser: doer, diff --git a/modules/notification/base/notifier.go b/modules/notification/base/notifier.go index 12fde1737d..1c607ded3b 100644 --- a/modules/notification/base/notifier.go +++ b/modules/notification/base/notifier.go @@ -6,7 +6,6 @@ package base import ( "code.gitea.io/gitea/models" - "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/repository" ) @@ -32,7 +31,7 @@ type Notifier interface { addedLabels []*models.Label, removedLabels []*models.Label) NotifyNewPullRequest(*models.PullRequest) - NotifyMergePullRequest(*models.PullRequest, *models.User, *git.Repository) + NotifyMergePullRequest(*models.PullRequest, *models.User) NotifyPullRequestSynchronized(doer *models.User, pr *models.PullRequest) NotifyPullRequestReview(*models.PullRequest, *models.Review, *models.Comment) NotifyPullRequestChangeTargetBranch(doer *models.User, pr *models.PullRequest, oldBranch string) diff --git a/modules/notification/base/null.go b/modules/notification/base/null.go index 1f90f6519d..f6c423b469 100644 --- a/modules/notification/base/null.go +++ b/modules/notification/base/null.go @@ -6,7 +6,6 @@ package base import ( "code.gitea.io/gitea/models" - "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/repository" ) @@ -44,7 +43,7 @@ func (*NullNotifier) NotifyPullRequestReview(pr *models.PullRequest, r *models.R } // NotifyMergePullRequest places a place holder function -func (*NullNotifier) NotifyMergePullRequest(pr *models.PullRequest, doer *models.User, baseRepo *git.Repository) { +func (*NullNotifier) NotifyMergePullRequest(pr *models.PullRequest, doer *models.User) { } // NotifyPullRequestSynchronized places a place holder function diff --git a/modules/notification/mail/mail.go b/modules/notification/mail/mail.go index 6cc6fda14b..ec7d9d617e 100644 --- a/modules/notification/mail/mail.go +++ b/modules/notification/mail/mail.go @@ -8,7 +8,6 @@ import ( "fmt" "code.gitea.io/gitea/models" - "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/notification/base" "code.gitea.io/gitea/services/mailer" @@ -101,7 +100,7 @@ func (m *mailNotifier) NotifyIssueChangeAssignee(doer *models.User, issue *model } } -func (m *mailNotifier) NotifyMergePullRequest(pr *models.PullRequest, doer *models.User, baseRepo *git.Repository) { +func (m *mailNotifier) NotifyMergePullRequest(pr *models.PullRequest, doer *models.User) { if err := pr.LoadIssue(); err != nil { log.Error("pr.LoadIssue: %v", err) return diff --git a/modules/notification/notification.go b/modules/notification/notification.go index ed7204c9e0..8c5d7d6035 100644 --- a/modules/notification/notification.go +++ b/modules/notification/notification.go @@ -6,7 +6,6 @@ package notification import ( "code.gitea.io/gitea/models" - "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/notification/action" "code.gitea.io/gitea/modules/notification/base" "code.gitea.io/gitea/modules/notification/indexer" @@ -61,9 +60,9 @@ func NotifyIssueChangeStatus(doer *models.User, issue *models.Issue, actionComme } // NotifyMergePullRequest notifies merge pull request to notifiers -func NotifyMergePullRequest(pr *models.PullRequest, doer *models.User, baseGitRepo *git.Repository) { +func NotifyMergePullRequest(pr *models.PullRequest, doer *models.User) { for _, notifier := range notifiers { - notifier.NotifyMergePullRequest(pr, doer, baseGitRepo) + notifier.NotifyMergePullRequest(pr, doer) } } diff --git a/modules/notification/ui/ui.go b/modules/notification/ui/ui.go index f58ebce6d7..a8c904e22c 100644 --- a/modules/notification/ui/ui.go +++ b/modules/notification/ui/ui.go @@ -6,7 +6,6 @@ package ui import ( "code.gitea.io/gitea/models" - "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/notification/base" ) @@ -69,7 +68,7 @@ func (ns *notificationService) NotifyIssueChangeStatus(doer *models.User, issue } } -func (ns *notificationService) NotifyMergePullRequest(pr *models.PullRequest, doer *models.User, gitRepo *git.Repository) { +func (ns *notificationService) NotifyMergePullRequest(pr *models.PullRequest, doer *models.User) { ns.issueQueue <- issueNotificationOpts{ issueID: pr.Issue.ID, notificationAuthorID: doer.ID, diff --git a/modules/notification/webhook/webhook.go b/modules/notification/webhook/webhook.go index 3f993df88e..df41078fb0 100644 --- a/modules/notification/webhook/webhook.go +++ b/modules/notification/webhook/webhook.go @@ -523,7 +523,7 @@ func (m *webhookNotifier) NotifyPushCommits(pusher *models.User, repo *models.Re } } -func (*webhookNotifier) NotifyMergePullRequest(pr *models.PullRequest, doer *models.User, baseRepo *git.Repository) { +func (*webhookNotifier) NotifyMergePullRequest(pr *models.PullRequest, doer *models.User) { // Reload pull request information. if err := pr.LoadAttributes(); err != nil { log.Error("LoadAttributes: %v", err) |