diff options
Diffstat (limited to 'routers')
-rw-r--r-- | routers/api/v1/repo/issue_comment.go | 2 | ||||
-rw-r--r-- | routers/repo/issue.go | 2 | ||||
-rw-r--r-- | routers/user/setting/account.go | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/routers/api/v1/repo/issue_comment.go b/routers/api/v1/repo/issue_comment.go index 245c90d49a..af69ae981a 100644 --- a/routers/api/v1/repo/issue_comment.go +++ b/routers/api/v1/repo/issue_comment.go @@ -509,7 +509,7 @@ func deleteIssueComment(ctx *context.APIContext) { return } - if err = comment_service.DeleteComment(comment, ctx.User); err != nil { + if err = comment_service.DeleteComment(ctx.User, comment); err != nil { ctx.Error(http.StatusInternalServerError, "DeleteCommentByID", err) return } diff --git a/routers/repo/issue.go b/routers/repo/issue.go index 6a532dc125..fbeae75ab5 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -2125,7 +2125,7 @@ func DeleteComment(ctx *context.Context) { return } - if err = comment_service.DeleteComment(comment, ctx.User); err != nil { + if err = comment_service.DeleteComment(ctx.User, comment); err != nil { ctx.ServerError("DeleteCommentByID", err) return } diff --git a/routers/user/setting/account.go b/routers/user/setting/account.go index 3b4191f0be..42c2c59b7e 100644 --- a/routers/user/setting/account.go +++ b/routers/user/setting/account.go @@ -302,8 +302,8 @@ func loadAccountData(ctx *context.Context) { ctx.Data["ActivationsPending"] = pendingActivation ctx.Data["CanAddEmails"] = !pendingActivation || !setting.Service.RegisterEmailConfirm - if setting.Service.UserDeleteWithCommentsMaxDays != 0 { - ctx.Data["UserDeleteWithCommentsMaxDays"] = setting.Service.UserDeleteWithCommentsMaxDays - ctx.Data["UserDeleteWithComments"] = ctx.User.CreatedUnix.AsTime().Add(time.Duration(setting.Service.UserDeleteWithCommentsMaxDays) * 24 * time.Hour).After(time.Now()) + if setting.Service.UserDeleteWithCommentsMaxTime != 0 { + ctx.Data["UserDeleteWithCommentsMaxTime"] = setting.Service.UserDeleteWithCommentsMaxTime.String() + ctx.Data["UserDeleteWithComments"] = ctx.User.CreatedUnix.AsTime().Add(setting.Service.UserDeleteWithCommentsMaxTime).After(time.Now()) } } |