|
|
|
@@ -839,6 +839,27 @@ func (issue *Issue) GetLastEventLabel() string { |
|
|
|
return "repo.issues.opened_by" |
|
|
|
} |
|
|
|
|
|
|
|
// GetLastComment return last comment for the current issue. |
|
|
|
func (issue *Issue) GetCloseUser() (*User, error) { |
|
|
|
var c Comment |
|
|
|
exist, err := x.Where("type = ?", CommentTypeClose). |
|
|
|
And("issue_id = ?", issue.ID).Desc("id").Get(&c) |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
if !exist { |
|
|
|
return nil, nil |
|
|
|
} |
|
|
|
err = c.LoadPoster() |
|
|
|
if err == nil { |
|
|
|
return c.Poster, nil |
|
|
|
} |
|
|
|
if issue.Poster == nil { |
|
|
|
issue.LoadPoster() |
|
|
|
} |
|
|
|
return issue.Poster, nil |
|
|
|
} |
|
|
|
|
|
|
|
// GetLastComment return last comment for the current issue. |
|
|
|
func (issue *Issue) GetLastComment() (*Comment, error) { |
|
|
|
var c Comment |
|
|
|
|