summaryrefslogtreecommitdiffstats
path: root/models/issue_comment.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_comment.go
parentc58fba944d701336daab57f0f0647850f7bb671f (diff)
downloadgitea-e0e44731723332ac49bb22e6d6d84ae4f92be067.tar.gz
gitea-e0e44731723332ac49bb22e6d6d84ae4f92be067.zip
extract some inline functions related with create comment (#8931)
Diffstat (limited to 'models/issue_comment.go')
-rw-r--r--models/issue_comment.go60
1 files changed, 0 insertions, 60 deletions
diff --git a/models/issue_comment.go b/models/issue_comment.go
index 37d4d8c115..7ac8c4df43 100644
--- a/models/issue_comment.go
+++ b/models/issue_comment.go
@@ -651,34 +651,6 @@ func sendCreateCommentAction(e *xorm.Session, opts *CreateCommentOptions, commen
return nil
}
-func createStatusComment(e *xorm.Session, doer *User, issue *Issue) (*Comment, error) {
- cmtType := CommentTypeClose
- if !issue.IsClosed {
- cmtType = CommentTypeReopen
- }
- return createComment(e, &CreateCommentOptions{
- Type: cmtType,
- Doer: doer,
- Repo: issue.Repo,
- Issue: issue,
- })
-}
-
-func createLabelComment(e *xorm.Session, doer *User, repo *Repository, issue *Issue, label *Label, add bool) (*Comment, error) {
- var content string
- if add {
- content = "1"
- }
- return createComment(e, &CreateCommentOptions{
- Type: CommentTypeLabel,
- Doer: doer,
- Repo: repo,
- Issue: issue,
- Label: label,
- Content: content,
- })
-}
-
func createMilestoneComment(e *xorm.Session, doer *User, repo *Repository, issue *Issue, oldMilestoneID, milestoneID int64) (*Comment, error) {
return createComment(e, &CreateCommentOptions{
Type: CommentTypeMilestone,
@@ -690,17 +662,6 @@ func createMilestoneComment(e *xorm.Session, doer *User, repo *Repository, issue
})
}
-func createAssigneeComment(e *xorm.Session, doer *User, repo *Repository, issue *Issue, assigneeID int64, removedAssignee bool) (*Comment, error) {
- return createComment(e, &CreateCommentOptions{
- Type: CommentTypeAssignees,
- Doer: doer,
- Repo: repo,
- Issue: issue,
- RemovedAssignee: removedAssignee,
- AssigneeID: assigneeID,
- })
-}
-
func createDeadlineComment(e *xorm.Session, doer *User, issue *Issue, newDeadlineUnix timeutil.TimeStamp) (*Comment, error) {
var content string
@@ -733,27 +694,6 @@ func createDeadlineComment(e *xorm.Session, doer *User, issue *Issue, newDeadlin
})
}
-func createChangeTitleComment(e *xorm.Session, doer *User, repo *Repository, issue *Issue, oldTitle, newTitle string) (*Comment, error) {
- return createComment(e, &CreateCommentOptions{
- Type: CommentTypeChangeTitle,
- Doer: doer,
- Repo: repo,
- Issue: issue,
- OldTitle: oldTitle,
- NewTitle: newTitle,
- })
-}
-
-func createDeleteBranchComment(e *xorm.Session, doer *User, repo *Repository, issue *Issue, branchName string) (*Comment, error) {
- return createComment(e, &CreateCommentOptions{
- Type: CommentTypeDeleteBranch,
- Doer: doer,
- Repo: repo,
- Issue: issue,
- CommitSHA: branchName,
- })
-}
-
// Creates issue dependency comment
func createIssueDependencyComment(e *xorm.Session, doer *User, issue *Issue, dependentIssue *Issue, add bool) (err error) {
cType := CommentTypeAddDependency