summaryrefslogtreecommitdiffstats
path: root/modules/notification/action
diff options
context:
space:
mode:
Diffstat (limited to 'modules/notification/action')
-rw-r--r--modules/notification/action/action.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/modules/notification/action/action.go b/modules/notification/action/action.go
index 52471c1107..d481bd8c4d 100644
--- a/modules/notification/action/action.go
+++ b/modules/notification/action/action.go
@@ -91,3 +91,29 @@ func (a *actionNotifier) NotifyRenameRepository(doer *models.User, repo *models.
log.Trace("action.renameRepoAction: %s/%s", doer.Name, repo.Name)
}
}
+
+func (a *actionNotifier) NotifyCreateRepository(doer *models.User, u *models.User, repo *models.Repository) {
+ if err := models.NotifyWatchers(&models.Action{
+ ActUserID: doer.ID,
+ ActUser: doer,
+ OpType: models.ActionCreateRepo,
+ RepoID: repo.ID,
+ Repo: repo,
+ IsPrivate: repo.IsPrivate,
+ }); err != nil {
+ log.Error("notify watchers '%d/%d': %v", doer.ID, repo.ID, err)
+ }
+}
+
+func (a *actionNotifier) NotifyForkRepository(doer *models.User, oldRepo, repo *models.Repository) {
+ if err := models.NotifyWatchers(&models.Action{
+ ActUserID: doer.ID,
+ ActUser: doer,
+ OpType: models.ActionCreateRepo,
+ RepoID: repo.ID,
+ Repo: repo,
+ IsPrivate: repo.IsPrivate,
+ }); err != nil {
+ log.Error("notify watchers '%d/%d': %v", doer.ID, repo.ID, err)
+ }
+}