Skip to content

Commit 3ff9d59

Browse files
committed
Remove unused comment actions
1 parent 2fc3eb1 commit 3ff9d59

File tree

6 files changed

+10
-43
lines changed

6 files changed

+10
-43
lines changed

models/issue.go

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -721,13 +721,10 @@ func (issue *Issue) ChangeTitle(doer *User, oldTitle string) (err error) {
721721
OldTitle: oldTitle,
722722
NewTitle: issue.Title,
723723
}
724-
comment, err := createCommentWithNoAction(sess, opts)
724+
_, err = createCommentWithNoAction(sess, opts)
725725
if err != nil {
726726
return fmt.Errorf("createComment: %v", err)
727727
}
728-
if err = sendCreateCommentAction(sess, opts, comment); err != nil {
729-
return err
730-
}
731728
if err = issue.addCrossReferences(sess, doer, true); err != nil {
732729
return err
733730
}
@@ -753,13 +750,10 @@ func AddDeletePRBranchComment(doer *User, repo *Repository, issueID int64, branc
753750
Issue: issue,
754751
CommitSHA: branchName,
755752
}
756-
comment, err := createCommentWithNoAction(sess, opts)
753+
_, err = createCommentWithNoAction(sess, opts)
757754
if err != nil {
758755
return err
759756
}
760-
if err = sendCreateCommentAction(sess, opts, comment); err != nil {
761-
return err
762-
}
763757

764758
return sess.Commit()
765759
}
@@ -899,14 +893,10 @@ func newIssue(e *xorm.Session, doer *User, opts NewIssueOptions) (err error) {
899893
OldMilestoneID: 0,
900894
MilestoneID: opts.Issue.MilestoneID,
901895
}
902-
comment, err := createCommentWithNoAction(e, opts)
896+
_, err = createCommentWithNoAction(e, opts)
903897
if err != nil {
904898
return err
905899
}
906-
907-
if err = sendCreateCommentAction(e, opts, comment); err != nil {
908-
return err
909-
}
910900
}
911901

912902
if opts.IsPull {

models/issue_assignees.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,6 @@ func (issue *Issue) toggleAssignee(sess *xorm.Session, doer *User, assigneeID in
144144
if err != nil {
145145
return false, nil, fmt.Errorf("createComment: %v", err)
146146
}
147-
if err = sendCreateCommentAction(sess, opts, comment); err != nil {
148-
return false, nil, err
149-
}
150147

151148
// if pull request is in the middle of creation - don't call webhook
152149
if isCreate {

models/issue_comment.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ func createDeadlineComment(e *xorm.Session, doer *User, issue *Issue, newDeadlin
678678
if err != nil {
679679
return nil, err
680680
}
681-
return comment, sendCreateCommentAction(e, opts, comment)
681+
return comment, nil
682682
}
683683

684684
// Creates issue dependency comment
@@ -699,13 +699,10 @@ func createIssueDependencyComment(e *xorm.Session, doer *User, issue *Issue, dep
699699
Issue: issue,
700700
DependentIssueID: dependentIssue.ID,
701701
}
702-
comment, err := createCommentWithNoAction(e, opts)
702+
_, err = createCommentWithNoAction(e, opts)
703703
if err != nil {
704704
return
705705
}
706-
if err = sendCreateCommentAction(e, opts, comment); err != nil {
707-
return err
708-
}
709706

710707
opts = &CreateCommentOptions{
711708
Type: cType,
@@ -714,13 +711,10 @@ func createIssueDependencyComment(e *xorm.Session, doer *User, issue *Issue, dep
714711
Issue: dependentIssue,
715712
DependentIssueID: issue.ID,
716713
}
717-
comment, err = createCommentWithNoAction(e, opts)
714+
_, err = createCommentWithNoAction(e, opts)
718715
if err != nil {
719716
return
720717
}
721-
if err = sendCreateCommentAction(e, opts, comment); err != nil {
722-
return err
723-
}
724718

725719
return
726720
}

models/issue_label.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -414,13 +414,10 @@ func newIssueLabel(e *xorm.Session, issue *Issue, label *Label, doer *User) (err
414414
Label: label,
415415
Content: "1",
416416
}
417-
comment, err := createCommentWithNoAction(e, opts)
417+
_, err = createCommentWithNoAction(e, opts)
418418
if err != nil {
419419
return err
420420
}
421-
if err = sendCreateCommentAction(e, opts, comment); err != nil {
422-
return err
423-
}
424421

425422
return updateLabel(e, label)
426423
}
@@ -494,13 +491,10 @@ func deleteIssueLabel(e *xorm.Session, issue *Issue, label *Label, doer *User) (
494491
Issue: issue,
495492
Label: label,
496493
}
497-
comment, err := createCommentWithNoAction(e, opts)
494+
_, err = createCommentWithNoAction(e, opts)
498495
if err != nil {
499496
return err
500497
}
501-
if err = sendCreateCommentAction(e, opts, comment); err != nil {
502-
return err
503-
}
504498

505499
return updateLabel(e, label)
506500
}

models/issue_lock.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,10 @@ func updateIssueLock(opts *IssueLockOptions, lock bool) error {
5252
Type: commentType,
5353
Content: opts.Reason,
5454
}
55-
comment, err := createCommentWithNoAction(sess, opt)
55+
_, err := createCommentWithNoAction(sess, opt)
5656
if err != nil {
5757
return err
5858
}
5959

60-
if err = sendCreateCommentAction(sess, opt, comment); err != nil {
61-
return err
62-
}
63-
6460
return sess.Commit()
6561
}

models/issue_milestone.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -394,14 +394,10 @@ func changeMilestoneAssign(e *xorm.Session, doer *User, issue *Issue, oldMilesto
394394
OldMilestoneID: oldMilestoneID,
395395
MilestoneID: issue.MilestoneID,
396396
}
397-
comment, err := createCommentWithNoAction(e, opts)
397+
_, err := createCommentWithNoAction(e, opts)
398398
if err != nil {
399399
return err
400400
}
401-
402-
if err := sendCreateCommentAction(e, opts, comment); err != nil {
403-
return err
404-
}
405401
}
406402

407403
return nil

0 commit comments

Comments
 (0)