1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-19 08:48:37 +00:00

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

@@ -386,7 +386,20 @@ func changeMilestoneAssign(e *xorm.Session, doer *User, issue *Issue, oldMilesto
return err
}
if _, err := createMilestoneComment(e, doer, issue.Repo, issue, oldMilestoneID, issue.MilestoneID); err != nil {
var opts = &CreateCommentOptions{
Type: CommentTypeMilestone,
Doer: doer,
Repo: issue.Repo,
Issue: issue,
OldMilestoneID: oldMilestoneID,
MilestoneID: issue.MilestoneID,
}
comment, err := createCommentWithNoAction(e, opts)
if err != nil {
return err
}
if err := sendCreateCommentAction(e, opts, comment); err != nil {
return err
}
}