forked from forgejo/forgejo
Move some actions to notification/action (#8779)
* Move some actions to notification/action * Fix test * fix test
This commit is contained in:
parent
fb459f2c2c
commit
016a5d0438
10 changed files with 88 additions and 107 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue