diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-11-24 13:16:59 +0800 |
---|---|---|
committer | techknowlogick <techknowlogick@gitea.io> | 2019-11-24 00:16:59 -0500 |
commit | 8ab35eefc4ff5db3f2f0a62f6f0272eae9be0585 (patch) | |
tree | 5249bcee68fb96652adc8f7dd46b604cbf15cd5e /modules/notification/notification.go | |
parent | e3f22ad2cca094cba057683f35f8536e3f71a582 (diff) | |
download | gitea-8ab35eefc4ff5db3f2f0a62f6f0272eae9be0585.tar.gz gitea-8ab35eefc4ff5db3f2f0a62f6f0272eae9be0585.zip |
Move mirror sync actions to notification (#9022)
* Move mirror sync actions to notification
* fix lint
Diffstat (limited to 'modules/notification/notification.go')
-rw-r--r-- | modules/notification/notification.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/modules/notification/notification.go b/modules/notification/notification.go index fa0b280e71..71d6e79e6d 100644 --- a/modules/notification/notification.go +++ b/modules/notification/notification.go @@ -227,3 +227,24 @@ func NotifyDeleteRef(pusher *models.User, repo *models.Repository, refType, refF notifier.NotifyDeleteRef(pusher, repo, refType, refFullName) } } + +// NotifySyncPushCommits notifies commits pushed to notifiers +func NotifySyncPushCommits(pusher *models.User, repo *models.Repository, refName, oldCommitID, newCommitID string, commits *models.PushCommits) { + for _, notifier := range notifiers { + notifier.NotifySyncPushCommits(pusher, repo, refName, oldCommitID, newCommitID, commits) + } +} + +// NotifySyncCreateRef notifies branch or tag creation to notifiers +func NotifySyncCreateRef(pusher *models.User, repo *models.Repository, refType, refFullName string) { + for _, notifier := range notifiers { + notifier.NotifySyncCreateRef(pusher, repo, refType, refFullName) + } +} + +// NotifySyncDeleteRef notifies branch or tag deletion to notifiers +func NotifySyncDeleteRef(pusher *models.User, repo *models.Repository, refType, refFullName string) { + for _, notifier := range notifiers { + notifier.NotifySyncDeleteRef(pusher, repo, refType, refFullName) + } +} |