summaryrefslogtreecommitdiffstats
path: root/modules/notification/notification.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-11-24 13:16:59 +0800
committertechknowlogick <techknowlogick@gitea.io>2019-11-24 00:16:59 -0500
commit8ab35eefc4ff5db3f2f0a62f6f0272eae9be0585 (patch)
tree5249bcee68fb96652adc8f7dd46b604cbf15cd5e /modules/notification/notification.go
parente3f22ad2cca094cba057683f35f8536e3f71a582 (diff)
downloadgitea-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.go21
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)
+ }
+}