return fmt.Errorf("watchRepo: %v", err)
}
}
- if err = notifyWatchers(e, &Action{
- ActUserID: doer.ID,
- ActUser: doer,
- OpType: ActionCreateRepo,
- RepoID: repo.ID,
- Repo: repo,
- IsPrivate: repo.IsPrivate,
- }); err != nil {
- return fmt.Errorf("notify watchers '%d/%d': %v", doer.ID, repo.ID, err)
- }
if err = copyDefaultWebhooksToRepo(e, repo.ID); err != nil {
return fmt.Errorf("copyDefaultWebhooksToRepo: %v", err)
log.Trace("action.renameRepoAction: %s/%s", doer.Name, repo.Name)
}
}
+
+func (a *actionNotifier) NotifyCreateRepository(doer *models.User, u *models.User, repo *models.Repository) {
+ if err := models.NotifyWatchers(&models.Action{
+ ActUserID: doer.ID,
+ ActUser: doer,
+ OpType: models.ActionCreateRepo,
+ RepoID: repo.ID,
+ Repo: repo,
+ IsPrivate: repo.IsPrivate,
+ }); err != nil {
+ log.Error("notify watchers '%d/%d': %v", doer.ID, repo.ID, err)
+ }
+}
+
+func (a *actionNotifier) NotifyForkRepository(doer *models.User, oldRepo, repo *models.Repository) {
+ if err := models.NotifyWatchers(&models.Action{
+ ActUserID: doer.ID,
+ ActUser: doer,
+ OpType: models.ActionCreateRepo,
+ RepoID: repo.ID,
+ Repo: repo,
+ IsPrivate: repo.IsPrivate,
+ }); err != nil {
+ log.Error("notify watchers '%d/%d': %v", doer.ID, repo.ID, err)
+ }
+}