diff options
Diffstat (limited to 'routers')
-rw-r--r-- | routers/api/v1/repo/issue_comment.go | 5 | ||||
-rw-r--r-- | routers/repo/issue.go | 5 | ||||
-rw-r--r-- | routers/repo/webhook.go | 13 |
3 files changed, 13 insertions, 10 deletions
diff --git a/routers/api/v1/repo/issue_comment.go b/routers/api/v1/repo/issue_comment.go index fe94fd71..4934302f 100644 --- a/routers/api/v1/repo/issue_comment.go +++ b/routers/api/v1/repo/issue_comment.go @@ -92,8 +92,9 @@ func EditIssueComment(ctx *context.APIContext, form api.EditIssueCommentOption) return } + oldContent := comment.Content comment.Content = form.Body - if err := models.UpdateComment(comment); err != nil { + if err := models.UpdateComment(ctx.User, comment, oldContent); err != nil { ctx.Error(500, "UpdateComment", err) return } @@ -119,7 +120,7 @@ func DeleteIssueComment(ctx *context.APIContext) { return } - if err = models.DeleteCommentByID(comment.ID); err != nil { + if err = models.DeleteCommentByID(ctx.User, comment.ID); err != nil { ctx.Error(500, "DeleteCommentByID", err) return } diff --git a/routers/repo/issue.go b/routers/repo/issue.go index a3cc9660..3b1d9305 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -906,6 +906,7 @@ func UpdateCommentContent(ctx *context.Context) { return } + oldContent := comment.Content comment.Content = ctx.Query("content") if len(comment.Content) == 0 { ctx.JSON(200, map[string]interface{}{ @@ -913,7 +914,7 @@ func UpdateCommentContent(ctx *context.Context) { }) return } - if err = models.UpdateComment(comment); err != nil { + if err = models.UpdateComment(ctx.User, comment, oldContent); err != nil { ctx.Handle(500, "UpdateComment", err) return } @@ -938,7 +939,7 @@ func DeleteComment(ctx *context.Context) { return } - if err = models.DeleteCommentByID(comment.ID); err != nil { + if err = models.DeleteCommentByID(ctx.User, comment.ID); err != nil { ctx.Handle(500, "DeleteCommentByID", err) return } diff --git a/routers/repo/webhook.go b/routers/repo/webhook.go index e1e03f03..65d9fee6 100644 --- a/routers/repo/webhook.go +++ b/routers/repo/webhook.go @@ -109,12 +109,13 @@ func ParseHookEvent(f form.Webhook) *models.HookEvent { SendEverything: f.SendEverything(), ChooseEvents: f.ChooseEvents(), HookEvents: models.HookEvents{ - Create: f.Create, - Delete: f.Delete, - Fork: f.Fork, - Push: f.Push, - Issues: f.Issues, - PullRequest: f.PullRequest, + Create: f.Create, + Delete: f.Delete, + Fork: f.Fork, + Push: f.Push, + Issues: f.Issues, + IssueComment: f.IssueComment, + PullRequest: f.PullRequest, }, } } |