summaryrefslogtreecommitdiffstats
path: root/models/issue_label.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-11-16 02:18:09 +0800
committerzeripath <art27@cantab.net>2019-11-15 18:18:09 +0000
commite0e44731723332ac49bb22e6d6d84ae4f92be067 (patch)
tree1af776de538d109e885cf971b7dd534b74afe926 /models/issue_label.go
parentc58fba944d701336daab57f0f0647850f7bb671f (diff)
downloadgitea-e0e44731723332ac49bb22e6d6d84ae4f92be067.tar.gz
gitea-e0e44731723332ac49bb22e6d6d84ae4f92be067.zip
extract some inline functions related with create comment (#8931)
Diffstat (limited to 'models/issue_label.go')
-rw-r--r--models/issue_label.go17
1 files changed, 15 insertions, 2 deletions
diff --git a/models/issue_label.go b/models/issue_label.go
index 497756af5b..77281e9bd4 100644
--- a/models/issue_label.go
+++ b/models/issue_label.go
@@ -402,7 +402,14 @@ func newIssueLabel(e *xorm.Session, issue *Issue, label *Label, doer *User) (err
return
}
- if _, err = createLabelComment(e, doer, issue.Repo, issue, label, true); err != nil {
+ if _, err = createComment(e, &CreateCommentOptions{
+ Type: CommentTypeLabel,
+ Doer: doer,
+ Repo: issue.Repo,
+ Issue: issue,
+ Label: label,
+ Content: "1",
+ }); err != nil {
return err
}
@@ -471,7 +478,13 @@ func deleteIssueLabel(e *xorm.Session, issue *Issue, label *Label, doer *User) (
return
}
- if _, err = createLabelComment(e, doer, issue.Repo, issue, label, false); err != nil {
+ if _, err = createComment(e, &CreateCommentOptions{
+ Type: CommentTypeLabel,
+ Doer: doer,
+ Repo: issue.Repo,
+ Issue: issue,
+ Label: label,
+ }); err != nil {
return err
}