Refactor notification for indexer (#5111)

* notification for indexer

* use NullNotifier as parent struct
This commit is contained in:
Lunny Xiao 2019-01-17 22:23:22 +08:00 committed by GitHub
parent 477a80f658
commit 82e08a3364
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 75 additions and 15 deletions

View file

@ -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)
}

View file

@ -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)
}