Refactor pull request review (#8954)

* refactor submit review

* remove unnecessary code

* remove unused comment

* fix lint

* remove duplicated actions

* remove duplicated actions

* fix typo

* fix comment content
This commit is contained in:
Lunny Xiao 2019-11-14 10:57:36 +08:00 committed by GitHub
parent 16a43156a8
commit dad67cae54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 291 additions and 251 deletions

View file

@ -539,8 +539,10 @@ func createComment(e *xorm.Session, opts *CreateCommentOptions) (_ *Comment, err
return nil, err
}
if err = sendCreateCommentAction(e, opts, comment); err != nil {
return nil, err
if !opts.NoAction {
if err = sendCreateCommentAction(e, opts, comment); err != nil {
return nil, err
}
}
if err = comment.addCrossReferences(e, opts.Doer); err != nil {
@ -816,6 +818,7 @@ type CreateCommentOptions struct {
RefCommentID int64
RefAction references.XRefAction
RefIsPull bool
NoAction bool
}
// CreateComment creates comment of issue or commit.