|
|
@@ -840,34 +840,6 @@ func (issue *Issue) GetLastEventLabel() string { |
|
|
|
} |
|
|
|
|
|
|
|
// GetLastComment return last comment for the current issue. |
|
|
|
func (issue *Issue) GetCloseUser() (*User, error) { |
|
|
|
var c Comment |
|
|
|
tmp := CommentTypeClose |
|
|
|
if issue.IsPull { |
|
|
|
tmp = CommentTypeMergePull |
|
|
|
} |
|
|
|
exist, err := x.Where("type = ?", tmp). |
|
|
|
And("issue_id = ?", issue.ID).Desc("id").Get(&c) |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
if !exist { |
|
|
|
if issue.Poster == nil { |
|
|
|
issue.LoadPoster() |
|
|
|
} |
|
|
|
return issue.Poster, nil |
|
|
|
} |
|
|
|
err = c.LoadPoster() |
|
|
|
if c.Poster != 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 |
|
|
|
exist, err := x.Where("type = ?", CommentTypeComment). |
|
|
|