aboutsummaryrefslogtreecommitdiffstats
path: root/modules/notification/action/action.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-11-09 04:54:50 +0800
committertechknowlogick <techknowlogick@gitea.io>2019-11-08 15:54:50 -0500
commit016a5d0438e551d4630819683dd6dc4fccb0cb51 (patch)
treebe5adb9e41fdd3e0b1528cca0c9e111ff81b4eb7 /modules/notification/action/action.go
parentfb459f2c2c32dda29870731b6dae1452bbab625f (diff)
downloadgitea-016a5d0438e551d4630819683dd6dc4fccb0cb51.tar.gz
gitea-016a5d0438e551d4630819683dd6dc4fccb0cb51.zip
Move some actions to notification/action (#8779)
* Move some actions to notification/action * Fix test * fix test
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)
+ }
+}