summaryrefslogtreecommitdiffstats
path: root/services/comments
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-11-24 17:49:20 +0800
committerGitHub <noreply@github.com>2021-11-24 17:49:20 +0800
commita666829a37be6f9fd98f9e7dd1767c420f7f3b32 (patch)
tree9ab1434b759a8a2cb275a83149903a823851e309 /services/comments
parent4e7ca946da2a2642a62f114825129bf5d7ed9196 (diff)
downloadgitea-a666829a37be6f9fd98f9e7dd1767c420f7f3b32.tar.gz
gitea-a666829a37be6f9fd98f9e7dd1767c420f7f3b32.zip
Move user related model into models/user (#17781)
* Move user related model into models/user * Fix lint for windows * Fix windows lint * Fix windows lint * Move some tests in models * Merge
Diffstat (limited to 'services/comments')
-rw-r--r--services/comments/comments.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/services/comments/comments.go b/services/comments/comments.go
index 2477f2d2b0..6e96301275 100644
--- a/services/comments/comments.go
+++ b/services/comments/comments.go
@@ -8,12 +8,13 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/issues"
+ user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/notification"
"code.gitea.io/gitea/modules/timeutil"
)
// CreateIssueComment creates a plain issue comment.
-func CreateIssueComment(doer *models.User, repo *models.Repository, issue *models.Issue, content string, attachments []string) (*models.Comment, error) {
+func CreateIssueComment(doer *user_model.User, repo *models.Repository, issue *models.Issue, content string, attachments []string) (*models.Comment, error) {
comment, err := models.CreateComment(&models.CreateCommentOptions{
Type: models.CommentTypeComment,
Doer: doer,
@@ -37,7 +38,7 @@ func CreateIssueComment(doer *models.User, repo *models.Repository, issue *model
}
// UpdateComment updates information of comment.
-func UpdateComment(c *models.Comment, doer *models.User, oldContent string) error {
+func UpdateComment(c *models.Comment, doer *user_model.User, oldContent string) error {
var needsContentHistory = c.Content != oldContent &&
(c.Type == models.CommentTypeComment || c.Type == models.CommentTypeReview || c.Type == models.CommentTypeCode)
if needsContentHistory {
@@ -70,7 +71,7 @@ func UpdateComment(c *models.Comment, doer *models.User, oldContent string) erro
}
// DeleteComment deletes the comment
-func DeleteComment(doer *models.User, comment *models.Comment) error {
+func DeleteComment(doer *user_model.User, comment *models.Comment) error {
if err := models.DeleteComment(comment); err != nil {
return err
}