diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-11-09 04:54:50 +0800 |
---|---|---|
committer | techknowlogick <techknowlogick@gitea.io> | 2019-11-08 15:54:50 -0500 |
commit | 016a5d0438e551d4630819683dd6dc4fccb0cb51 (patch) | |
tree | be5adb9e41fdd3e0b1528cca0c9e111ff81b4eb7 /modules/notification/action/action.go | |
parent | fb459f2c2c32dda29870731b6dae1452bbab625f (diff) | |
download | gitea-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.go | 18 |
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) + } +} |