From 6e81eafdd6b5db756d4ea30d759bac944b80e2de Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Mon, 2 Dec 2019 22:43:39 +0800 Subject: Remove unused comment actions (#9222) * Remove unused comment actions * improve code --- models/issue_comment.go | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'models/issue_comment.go') diff --git a/models/issue_comment.go b/models/issue_comment.go index 1fad141d92..5843689f1b 100644 --- a/models/issue_comment.go +++ b/models/issue_comment.go @@ -678,7 +678,7 @@ func createDeadlineComment(e *xorm.Session, doer *User, issue *Issue, newDeadlin if err != nil { return nil, err } - return comment, sendCreateCommentAction(e, opts, comment) + return comment, nil } // Creates issue dependency comment @@ -699,13 +699,9 @@ func createIssueDependencyComment(e *xorm.Session, doer *User, issue *Issue, dep Issue: issue, DependentIssueID: dependentIssue.ID, } - comment, err := createCommentWithNoAction(e, opts) - if err != nil { + if _, err = createCommentWithNoAction(e, opts); err != nil { return } - if err = sendCreateCommentAction(e, opts, comment); err != nil { - return err - } opts = &CreateCommentOptions{ Type: cType, @@ -714,14 +710,7 @@ func createIssueDependencyComment(e *xorm.Session, doer *User, issue *Issue, dep Issue: dependentIssue, DependentIssueID: issue.ID, } - comment, err = createCommentWithNoAction(e, opts) - if err != nil { - return - } - if err = sendCreateCommentAction(e, opts, comment); err != nil { - return err - } - + _, err = createCommentWithNoAction(e, opts) return } -- cgit v1.2.3