summaryrefslogtreecommitdiffstats
path: root/modules/notification/action/action.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/notification/action/action.go')
-rw-r--r--modules/notification/action/action.go18
1 files changed, 17 insertions, 1 deletions
diff --git a/modules/notification/action/action.go b/modules/notification/action/action.go
index 15228f65e7..52471c1107 100644
--- a/modules/notification/action/action.go
+++ b/modules/notification/action/action.go
@@ -20,7 +20,7 @@ var (
_ base.Notifier = &actionNotifier{}
)
-// NewNotifier create a new webhookNotifier notifier
+// NewNotifier create a new actionNotifier notifier
func NewNotifier() base.Notifier {
return &actionNotifier{}
}
@@ -75,3 +75,19 @@ func (a *actionNotifier) NotifyNewPullRequest(pull *models.PullRequest) {
log.Error("NotifyWatchers: %v", err)
}
}
+
+func (a *actionNotifier) NotifyRenameRepository(doer *models.User, repo *models.Repository, oldName string) {
+ if err := models.NotifyWatchers(&models.Action{
+ ActUserID: doer.ID,
+ ActUser: doer,
+ OpType: models.ActionRenameRepo,
+ RepoID: repo.ID,
+ Repo: repo,
+ IsPrivate: repo.IsPrivate,
+ Content: oldName,
+ }); err != nil {
+ log.Error("notify watchers: %v", err)
+ } else {
+ log.Trace("action.renameRepoAction: %s/%s", doer.Name, repo.Name)
+ }
+}