summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-29 07:50:25 -0400
committerUnknown <joe2010xtmf@163.com>2014-03-29 07:50:25 -0400
commit828282882066aa4e8bd8fb0c083c530607bc34bb (patch)
tree4ac056c6d088a046d5b848c872c363cd6bc0276b /modules
parent879ef8d81fa7dd194a7482c870cecab5a5ac964b (diff)
downloadgitea-828282882066aa4e8bd8fb0c083c530607bc34bb.tar.gz
gitea-828282882066aa4e8bd8fb0c083c530607bc34bb.zip
Fix action email bug
Diffstat (limited to 'modules')
-rw-r--r--modules/base/tool.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/base/tool.go b/modules/base/tool.go
index d005ffe355..6876da7625 100644
--- a/modules/base/tool.go
+++ b/modules/base/tool.go
@@ -478,6 +478,7 @@ func (a argInt) Get(i int, args ...int) (r int) {
type Actioner interface {
GetOpType() int
GetActUserName() string
+ GetActEmail() string
GetRepoName() string
GetBranch() string
GetContent() string
@@ -520,8 +521,9 @@ type PushCommits struct {
// ActionDesc accepts int that represents action operation type
// and returns the description.
-func ActionDesc(act Actioner, avatarLink string) string {
+func ActionDesc(act Actioner) string {
actUserName := act.GetActUserName()
+ email := act.GetActEmail()
repoName := act.GetRepoName()
repoLink := actUserName + "/" + repoName
branch := act.GetBranch()
@@ -536,7 +538,7 @@ func ActionDesc(act Actioner, avatarLink string) string {
}
buf := bytes.NewBuffer([]byte("\n"))
for _, commit := range push.Commits {
- buf.WriteString(fmt.Sprintf(TPL_COMMIT_REPO_LI, avatarLink, repoLink, commit.Sha1, commit.Sha1[:7], commit.Message) + "\n")
+ buf.WriteString(fmt.Sprintf(TPL_COMMIT_REPO_LI, AvatarLink(commit.AuthorEmail), repoLink, commit.Sha1, commit.Sha1[:7], commit.Message) + "\n")
}
if push.Len > 3 {
buf.WriteString(fmt.Sprintf(`<div><a href="/%s/%s/commits/%s">%d other commits >></a></div>`, actUserName, repoName, branch, push.Len))
@@ -546,7 +548,7 @@ func ActionDesc(act Actioner, avatarLink string) string {
case 6: // Create issue.
infos := strings.SplitN(content, "|", 2)
return fmt.Sprintf(TPL_CREATE_Issue, actUserName, actUserName, repoLink, infos[0], repoLink, infos[0],
- avatarLink, infos[1])
+ AvatarLink(email), infos[1])
default:
return "invalid type"
}