extract some inline functions related with create comment (#8931)

This commit is contained in:
2019-11-16 02:18:09 +08:00
committed by zeripath
parent c58fba944d
commit e0e4473172
5 changed files with 65 additions and 88 deletions

View File

@ -120,9 +120,16 @@ func (issue *Issue) toggleAssignee(sess *xorm.Session, doer *User, assigneeID in
}
// Comment
comment, err = createAssigneeComment(sess, doer, issue.Repo, issue, assigneeID, removed)
comment, err = createComment(sess, &CreateCommentOptions{
Type: CommentTypeAssignees,
Doer: doer,
Repo: issue.Repo,
Issue: issue,
RemovedAssignee: removed,
AssigneeID: assigneeID,
})
if err != nil {
return false, nil, fmt.Errorf("createAssigneeComment: %v", err)
return false, nil, fmt.Errorf("createComment: %v", err)
}
// if pull request is in the middle of creation - don't call webhook