|
|
@ -40,7 +40,6 @@ type Action struct { |
|
|
|
RepoId int64 |
|
|
|
RepoId int64 |
|
|
|
RepoName string |
|
|
|
RepoName string |
|
|
|
RefName string |
|
|
|
RefName string |
|
|
|
IsPrivate bool `xorm:"not null"` |
|
|
|
|
|
|
|
Content string `xorm:"TEXT"` |
|
|
|
Content string `xorm:"TEXT"` |
|
|
|
Created time.Time `xorm:"created"` |
|
|
|
Created time.Time `xorm:"created"` |
|
|
|
} |
|
|
|
} |
|
|
@ -102,8 +101,7 @@ func CommitRepoAction(userId int64, userName, actEmail string, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if err = NotifyWatchers(&Action{ActUserId: userId, ActUserName: userName, ActEmail: actEmail, |
|
|
|
if err = NotifyWatchers(&Action{ActUserId: userId, ActUserName: userName, ActEmail: actEmail, |
|
|
|
OpType: opType, Content: string(bs), RepoId: repoId, RepoName: repoName, RefName: refName, |
|
|
|
OpType: opType, Content: string(bs), RepoId: repoId, RepoName: repoName, RefName: refName}); err != nil { |
|
|
|
IsPrivate: repo.IsPrivate}); err != nil { |
|
|
|
|
|
|
|
log.Error("action.CommitRepoAction(notify watchers): %d/%s", userId, repoName) |
|
|
|
log.Error("action.CommitRepoAction(notify watchers): %d/%s", userId, repoName) |
|
|
|
return err |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
@ -115,7 +113,7 @@ func CommitRepoAction(userId int64, userName, actEmail string, |
|
|
|
// NewRepoAction adds new action for creating repository.
|
|
|
|
// NewRepoAction adds new action for creating repository.
|
|
|
|
func NewRepoAction(user *User, repo *Repository) (err error) { |
|
|
|
func NewRepoAction(user *User, repo *Repository) (err error) { |
|
|
|
if err = NotifyWatchers(&Action{ActUserId: user.Id, ActUserName: user.Name, ActEmail: user.Email, |
|
|
|
if err = NotifyWatchers(&Action{ActUserId: user.Id, ActUserName: user.Name, ActEmail: user.Email, |
|
|
|
OpType: OP_CREATE_REPO, RepoId: repo.Id, RepoName: repo.Name, IsPrivate: repo.IsPrivate}); err != nil { |
|
|
|
OpType: OP_CREATE_REPO, RepoId: repo.Id, RepoName: repo.Name}); err != nil { |
|
|
|
log.Error("action.NewRepoAction(notify watchers): %d/%s", user.Id, repo.Name) |
|
|
|
log.Error("action.NewRepoAction(notify watchers): %d/%s", user.Id, repo.Name) |
|
|
|
return err |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
@ -127,8 +125,7 @@ func NewRepoAction(user *User, repo *Repository) (err error) { |
|
|
|
// TransferRepoAction adds new action for transfering repository.
|
|
|
|
// TransferRepoAction adds new action for transfering repository.
|
|
|
|
func TransferRepoAction(user, newUser *User, repo *Repository) (err error) { |
|
|
|
func TransferRepoAction(user, newUser *User, repo *Repository) (err error) { |
|
|
|
if err = NotifyWatchers(&Action{ActUserId: user.Id, ActUserName: user.Name, ActEmail: user.Email, |
|
|
|
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, |
|
|
|
OpType: OP_TRANSFER_REPO, RepoId: repo.Id, RepoName: repo.Name, Content: newUser.Name}); err != nil { |
|
|
|
IsPrivate: repo.IsPrivate}); err != nil { |
|
|
|
|
|
|
|
log.Error("action.TransferRepoAction(notify watchers): %d/%s", user.Id, repo.Name) |
|
|
|
log.Error("action.TransferRepoAction(notify watchers): %d/%s", user.Id, repo.Name) |
|
|
|
return err |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|