diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-11-15 16:06:11 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-15 16:06:11 +0800 |
commit | 21ae9838e04233bbf9930d368d935fd1f9b68c34 (patch) | |
tree | 610abb6f1ec2df235d469276b36f6d26e00e4653 /modules/notification/notification.go | |
parent | b30d744e0986dcf716d4f57dac8c72a494bb226b (diff) | |
download | gitea-21ae9838e04233bbf9930d368d935fd1f9b68c34.tar.gz gitea-21ae9838e04233bbf9930d368d935fd1f9b68c34.zip |
Move transfer repository and rename repository on a service package and start action notification (#8573)
* move transfer repository and rename repository on a service package and start action notification
* remove unused codes
* fix lint
* fix bugs
* fix test
* fix test
* fix test
* fix lint
* update go mod and sum
Diffstat (limited to 'modules/notification/notification.go')
-rw-r--r-- | modules/notification/notification.go | 49 |
1 files changed, 28 insertions, 21 deletions
diff --git a/modules/notification/notification.go b/modules/notification/notification.go index fdfcc62ffe..fa0b280e71 100644 --- a/modules/notification/notification.go +++ b/modules/notification/notification.go @@ -101,27 +101,6 @@ func NotifyDeleteComment(doer *models.User, c *models.Comment) { } } -// NotifyDeleteRepository notifies delete repository to notifiers -func NotifyDeleteRepository(doer *models.User, repo *models.Repository) { - for _, notifier := range notifiers { - notifier.NotifyDeleteRepository(doer, repo) - } -} - -// NotifyForkRepository notifies fork repository to notifiers -func NotifyForkRepository(doer *models.User, oldRepo, repo *models.Repository) { - for _, notifier := range notifiers { - notifier.NotifyForkRepository(doer, oldRepo, repo) - } -} - -// NotifyRenameRepository notifies repository renamed -func NotifyRenameRepository(doer *models.User, repo *models.Repository, oldName string) { - for _, notifier := range notifiers { - notifier.NotifyRenameRepository(doer, repo, oldName) - } -} - // NotifyNewRelease notifies new release to notifiers func NotifyNewRelease(rel *models.Release) { for _, notifier := range notifiers { @@ -200,6 +179,34 @@ func NotifyMigrateRepository(doer *models.User, u *models.User, repo *models.Rep } } +// NotifyTransferRepository notifies create repository to notifiers +func NotifyTransferRepository(doer *models.User, repo *models.Repository, newOwnerName string) { + for _, notifier := range notifiers { + notifier.NotifyTransferRepository(doer, repo, newOwnerName) + } +} + +// NotifyDeleteRepository notifies delete repository to notifiers +func NotifyDeleteRepository(doer *models.User, repo *models.Repository) { + for _, notifier := range notifiers { + notifier.NotifyDeleteRepository(doer, repo) + } +} + +// NotifyForkRepository notifies fork repository to notifiers +func NotifyForkRepository(doer *models.User, oldRepo, repo *models.Repository) { + for _, notifier := range notifiers { + notifier.NotifyForkRepository(doer, oldRepo, repo) + } +} + +// NotifyRenameRepository notifies repository renamed +func NotifyRenameRepository(doer *models.User, repo *models.Repository, oldName string) { + for _, notifier := range notifiers { + notifier.NotifyRenameRepository(doer, repo, oldName) + } +} + // NotifyPushCommits notifies commits pushed to notifiers func NotifyPushCommits(pusher *models.User, repo *models.Repository, refName, oldCommitID, newCommitID string, commits *models.PushCommits) { for _, notifier := range notifiers { |