mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 02:38:35 +00:00
Move some actions to notification/action (#8779)
* Move some actions to notification/action * Fix test * fix test
This commit is contained in:
committed by
techknowlogick
parent
fb459f2c2c
commit
016a5d0438
@@ -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)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user