summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-05-01 20:29:51 -0400
committerUnknown <joe2010xtmf@163.com>2014-05-01 20:29:51 -0400
commitcd2020429a8331fc4a2a4d9afa72be756343a51b (patch)
tree4adf1f97de8d0528e4afcf8c2f3e8b2065c04e98 /models
parentff9872104e8d2323420e084870da0625167b5e55 (diff)
downloadgitea-cd2020429a8331fc4a2a4d9afa72be756343a51b.tar.gz
gitea-cd2020429a8331fc4a2a4d9afa72be756343a51b.zip
Fix #153
Diffstat (limited to 'models')
-rw-r--r--models/action.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/models/action.go b/models/action.go
index 61fd0a4428..d9efdc5559 100644
--- a/models/action.go
+++ b/models/action.go
@@ -40,6 +40,7 @@ type Action struct {
RepoId int64
RepoName string
RefName string
+ IsPrivate bool `xorm:"NOT NULL DEFAULT false"`
Content string `xorm:"TEXT"`
Created time.Time `xorm:"created"`
}
@@ -101,7 +102,8 @@ func CommitRepoAction(userId int64, userName, actEmail string,
}
if err = NotifyWatchers(&Action{ActUserId: userId, ActUserName: userName, ActEmail: actEmail,
- OpType: opType, Content: string(bs), RepoId: repoId, RepoName: repoName, RefName: refName}); err != nil {
+ OpType: opType, Content: string(bs), RepoId: repoId, RepoName: repoName, RefName: refName,
+ IsPrivate: repo.IsPrivate}); err != nil {
log.Error("action.CommitRepoAction(notify watchers): %d/%s", userId, repoName)
return err
}
@@ -113,7 +115,7 @@ func CommitRepoAction(userId int64, userName, actEmail string,
// NewRepoAction adds new action for creating repository.
func NewRepoAction(user *User, repo *Repository) (err error) {
if err = NotifyWatchers(&Action{ActUserId: user.Id, ActUserName: user.Name, ActEmail: user.Email,
- OpType: OP_CREATE_REPO, RepoId: repo.Id, RepoName: repo.Name}); err != nil {
+ OpType: OP_CREATE_REPO, RepoId: repo.Id, RepoName: repo.Name, IsPrivate: repo.IsPrivate}); err != nil {
log.Error("action.NewRepoAction(notify watchers): %d/%s", user.Id, repo.Name)
return err
}
@@ -125,7 +127,8 @@ func NewRepoAction(user *User, repo *Repository) (err error) {
// TransferRepoAction adds new action for transfering repository.
func TransferRepoAction(user, newUser *User, repo *Repository) (err error) {
if err = NotifyWatchers(&Action{ActUserId: user.Id, ActUserName: user.Name, ActEmail: user.Email,
- OpType: OP_TRANSFER_REPO, RepoId: repo.Id, RepoName: repo.Name, Content: newUser.Name}); err != nil {
+ OpType: OP_TRANSFER_REPO, RepoId: repo.Id, RepoName: repo.Name, Content: newUser.Name,
+ IsPrivate: repo.IsPrivate}); err != nil {
log.Error("action.TransferRepoAction(notify watchers): %d/%s", user.Id, repo.Name)
return err
}