aboutsummaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2019-01-17 22:23:22 +0800
committerGitHub <noreply@github.com>2019-01-17 22:23:22 +0800
commit82e08a3364195b515a005180c2bdc08e78aac208 (patch)
treef8ae9f914ab522224e57fcf94675a7f7dd39006e /routers
parent477a80f658a04fc477d800887c55654ac307ff45 (diff)
downloadgitea-82e08a3364195b515a005180c2bdc08e78aac208.tar.gz
gitea-82e08a3364195b515a005180c2bdc08e78aac208.zip
Refactor notification for indexer (#5111)
* notification for indexer * use NullNotifier as parent struct
Diffstat (limited to 'routers')
-rw-r--r--routers/api/v1/repo/issue_comment.go6
-rw-r--r--routers/repo/issue.go4
2 files changed, 10 insertions, 0 deletions
diff --git a/routers/api/v1/repo/issue_comment.go b/routers/api/v1/repo/issue_comment.go
index a3fc6f41f3..720513f007 100644
--- a/routers/api/v1/repo/issue_comment.go
+++ b/routers/api/v1/repo/issue_comment.go
@@ -283,6 +283,9 @@ func editIssueComment(ctx *context.APIContext, form api.EditIssueCommentOption)
ctx.Error(500, "UpdateComment", err)
return
}
+
+ notification.NotifyUpdateComment(ctx.User, comment, oldContent)
+
ctx.JSON(200, comment.APIFormat())
}
@@ -371,5 +374,8 @@ func deleteIssueComment(ctx *context.APIContext) {
ctx.Error(500, "DeleteCommentByID", err)
return
}
+
+ notification.NotifyDeleteComment(ctx.User, comment)
+
ctx.Status(204)
}
diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index f025cc3887..6c6c2612bf 100644
--- a/routers/repo/issue.go
+++ b/routers/repo/issue.go
@@ -1232,6 +1232,8 @@ func UpdateCommentContent(ctx *context.Context) {
return
}
+ notification.NotifyUpdateComment(ctx.User, comment, oldContent)
+
ctx.JSON(200, map[string]interface{}{
"content": string(markdown.Render([]byte(comment.Content), ctx.Query("context"), ctx.Repo.Repository.ComposeMetas())),
})
@@ -1263,6 +1265,8 @@ func DeleteComment(ctx *context.Context) {
return
}
+ notification.NotifyDeleteComment(ctx.User, comment)
+
ctx.Status(200)
}