1
0
Fork 0
forked from forgejo/forgejo

Extract createComment (#9125)

* Extract createComment

* fix lint

* fix lint
This commit is contained in:
Lunny Xiao 2019-12-01 10:44:39 +08:00 committed by techknowlogick
parent 7c6f2e27be
commit 2011a5b818
9 changed files with 130 additions and 53 deletions

View file

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