mirror of
https://github.com/go-gitea/gitea
synced 2025-07-23 02:38:35 +00:00
some refactors for issue and comments (#2419)
This commit is contained in:
@@ -1206,8 +1206,12 @@ func Issues(opts *IssuesOptions) ([]*Issue, error) {
|
||||
|
||||
// GetParticipantsByIssueID returns all users who are participated in comments of an issue.
|
||||
func GetParticipantsByIssueID(issueID int64) ([]*User, error) {
|
||||
return getParticipantsByIssueID(x, issueID)
|
||||
}
|
||||
|
||||
func getParticipantsByIssueID(e Engine, issueID int64) ([]*User, error) {
|
||||
userIDs := make([]int64, 0, 5)
|
||||
if err := x.Table("comment").Cols("poster_id").
|
||||
if err := e.Table("comment").Cols("poster_id").
|
||||
Where("issue_id = ?", issueID).
|
||||
And("type = ?", CommentTypeComment).
|
||||
Distinct("poster_id").
|
||||
@@ -1219,7 +1223,7 @@ func GetParticipantsByIssueID(issueID int64) ([]*User, error) {
|
||||
}
|
||||
|
||||
users := make([]*User, 0, len(userIDs))
|
||||
return users, x.In("id", userIDs).Find(&users)
|
||||
return users, e.In("id", userIDs).Find(&users)
|
||||
}
|
||||
|
||||
// UpdateIssueMentions extracts mentioned people from content and
|
||||
|
Reference in New Issue
Block a user