diff options
Diffstat (limited to 'models/action.go')
-rw-r--r-- | models/action.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/models/action.go b/models/action.go index e94bb9441b..19fd9102fb 100644 --- a/models/action.go +++ b/models/action.go @@ -15,6 +15,7 @@ import ( "unicode" "github.com/go-xorm/xorm" + "github.com/Unknwon/com" api "github.com/gogits/go-gogs-client" @@ -136,6 +137,16 @@ func (a Action) GetIssueInfos() []string { return strings.SplitN(a.Content, "|", 2) } +func (a Action) GetIssueTitle() string { + issueIndex := com.StrTo(a.GetIssueInfos()[0]).MustInt64() + issue, err := GetIssueByIndex(a.RepoID, issueIndex) + if err != nil { + log.Error(4, "GetIssueByID: %v", err) + return "500 when get title" + } + return issue.Name +} + func newRepoAction(e Engine, u *User, repo *Repository) (err error) { if err = notifyWatchers(e, &Action{ ActUserID: u.Id, |