summaryrefslogtreecommitdiffstats
path: root/models/action.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-27 11:37:33 -0400
committerUnknown <joe2010xtmf@163.com>2014-03-27 11:37:33 -0400
commitf470c241d6b1de30e4f500a6cf69f6ecd0cf8b41 (patch)
treeaba8fc0973c410c938af5988e2e5d09374252738 /models/action.go
parentc796ed3849e3cd5b28cc8234edc71bbedafbc7da (diff)
downloadgitea-f470c241d6b1de30e4f500a6cf69f6ecd0cf8b41.tar.gz
gitea-f470c241d6b1de30e4f500a6cf69f6ecd0cf8b41.zip
IP: RC Code Review
Diffstat (limited to 'models/action.go')
-rw-r--r--models/action.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/models/action.go b/models/action.go
index edf1bf58f9..46704eef07 100644
--- a/models/action.go
+++ b/models/action.go
@@ -23,7 +23,8 @@ const (
OP_PULL_REQUEST
)
-// Action represents user operation type and information to the repository.
+// Action represents user operation type and other information to repository.,
+// it implemented interface base.Actioner so that can be used in template render.
type Action struct {
Id int64
UserId int64 // Receiver user id.
@@ -57,7 +58,7 @@ func (a Action) GetContent() string {
return a.Content
}
-// CommitRepoAction records action for commit repository.
+// CommitRepoAction adds new action for committing repository.
func CommitRepoAction(userId int64, userName string,
repoId int64, repoName string, refName string, commits *base.PushCommits) error {
log.Trace("action.CommitRepoAction(start): %d/%s", userId, repoName)
@@ -68,12 +69,13 @@ func CommitRepoAction(userId int64, userName string,
return err
}
- if err = NotifyWatchers(userId, repoId, OP_COMMIT_REPO, userName, repoName, refName, string(bs)); err != nil {
+ if err = NotifyWatchers(&Action{ActUserId: userId, ActUserName: userName, OpType: OP_COMMIT_REPO,
+ Content: string(bs), RepoId: repoId, RepoName: repoName, RefName: refName}); err != nil {
log.Error("action.CommitRepoAction(notify watchers): %d/%s", userId, repoName)
return err
}
- // Update repository last update time.
+ // Change repository bare status and update last updated time.
repo, err := GetRepositoryByName(userId, repoName)
if err != nil {
log.Error("action.CommitRepoAction(GetRepositoryByName): %d/%s", userId, repoName)