diff options
author | Unknown <joe2010xtmf@163.com> | 2014-03-29 07:50:25 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-03-29 07:50:25 -0400 |
commit | 828282882066aa4e8bd8fb0c083c530607bc34bb (patch) | |
tree | 4ac056c6d088a046d5b848c872c363cd6bc0276b /models/action.go | |
parent | 879ef8d81fa7dd194a7482c870cecab5a5ac964b (diff) | |
download | gitea-828282882066aa4e8bd8fb0c083c530607bc34bb.tar.gz gitea-828282882066aa4e8bd8fb0c083c530607bc34bb.zip |
Fix action email bug
Diffstat (limited to 'models/action.go')
-rw-r--r-- | models/action.go | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/models/action.go b/models/action.go index 9d99df8546..894855784f 100644 --- a/models/action.go +++ b/models/action.go @@ -31,6 +31,7 @@ type Action struct { OpType int // Operations: CREATE DELETE STAR ... ActUserId int64 // Action user id. ActUserName string // Action user name. + ActEmail string RepoId int64 RepoName string RefName string @@ -46,6 +47,10 @@ func (a Action) GetActUserName() string { return a.ActUserName } +func (a Action) GetActEmail() string { + return a.ActEmail +} + func (a Action) GetRepoName() string { return a.RepoName } @@ -69,8 +74,8 @@ func CommitRepoAction(userId int64, userName string, return err } - if err = NotifyWatchers(&Action{ActUserId: userId, ActUserName: userName, OpType: OP_COMMIT_REPO, - Content: string(bs), RepoId: repoId, RepoName: repoName, RefName: refName}); err != nil { + if err = NotifyWatchers(&Action{ActUserId: userId, ActUserName: userName, ActEmail: "", + 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 } @@ -93,8 +98,8 @@ func CommitRepoAction(userId int64, userName 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, OpType: OP_CREATE_REPO, - RepoId: repo.Id, RepoName: repo.Name}); err != nil { + 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 { log.Error("action.NewRepoAction(notify watchers): %d/%s", user.Id, repo.Name) return err } |