diff options
Diffstat (limited to 'models/issue.go')
-rw-r--r-- | models/issue.go | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/models/issue.go b/models/issue.go index 3893048533..1fe9140dad 100644 --- a/models/issue.go +++ b/models/issue.go @@ -652,7 +652,16 @@ func (issue *Issue) changeStatus(e *xorm.Session, doer *User, isClosed bool) (er } // New action comment - if _, err = createStatusComment(e, doer, issue); err != nil { + cmtType := CommentTypeClose + if !issue.IsClosed { + cmtType = CommentTypeReopen + } + if _, err := createComment(e, &CreateCommentOptions{ + Type: cmtType, + Doer: doer, + Repo: issue.Repo, + Issue: issue, + }); err != nil { return err } @@ -702,8 +711,15 @@ func (issue *Issue) ChangeTitle(doer *User, oldTitle string) (err error) { return fmt.Errorf("loadRepo: %v", err) } - if _, err = createChangeTitleComment(sess, doer, issue.Repo, issue, oldTitle, issue.Title); err != nil { - return fmt.Errorf("createChangeTitleComment: %v", err) + if _, err = createComment(sess, &CreateCommentOptions{ + Type: CommentTypeChangeTitle, + Doer: doer, + Repo: issue.Repo, + Issue: issue, + OldTitle: oldTitle, + NewTitle: issue.Title, + }); err != nil { + return fmt.Errorf("createComment: %v", err) } if err = issue.neuterCrossReferences(sess); err != nil { @@ -728,7 +744,13 @@ func AddDeletePRBranchComment(doer *User, repo *Repository, issueID int64, branc if err := sess.Begin(); err != nil { return err } - if _, err := createDeleteBranchComment(sess, doer, repo, issue, branchName); err != nil { + if _, err := createComment(sess, &CreateCommentOptions{ + Type: CommentTypeDeleteBranch, + Doer: doer, + Repo: repo, + Issue: issue, + CommitSHA: branchName, + }); err != nil { return err } |