diff options
author | FuXiaoHei <fuxiaohei@hexiaz.com> | 2014-04-06 14:54:39 +0800 |
---|---|---|
committer | FuXiaoHei <fuxiaohei@hexiaz.com> | 2014-04-06 14:54:39 +0800 |
commit | 98f918ed28d5a8b1c131cda587a06714a768f951 (patch) | |
tree | 04b202dfc2f639eba39304c8051bde8270b5349c /models/action.go | |
parent | 3ede496383bc0e5ad2cb9c5f034890bb6d626b3c (diff) | |
parent | b7c3b0cc73ad8721e2eec59d018a91850ba7f750 (diff) |
Merge branch 'dev' of https://github.com/gogits/gogs into dev
Diffstat (limited to 'models/action.go')
-rw-r--r-- | models/action.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/models/action.go b/models/action.go index 1e55df85..a642a82c 100644 --- a/models/action.go +++ b/models/action.go @@ -21,6 +21,7 @@ const ( OP_COMMIT_REPO OP_CREATE_ISSUE OP_PULL_REQUEST + OP_TRANSFER_REPO ) // Action represents user operation type and other information to repository., @@ -108,6 +109,18 @@ func NewRepoAction(user *User, repo *Repository) (err error) { return err } +// 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 { + log.Error("action.TransferRepoAction(notify watchers): %d/%s", user.Id, repo.Name) + return err + } + + log.Trace("action.TransferRepoAction: %s/%s", user.LowerName, repo.LowerName) + return err +} + // GetFeeds returns action list of given user in given context. func GetFeeds(userid, offset int64, isProfile bool) ([]Action, error) { actions := make([]Action, 0, 20) |