From fd7d83ace60258acf7139c4c787aa8af75b7ba8c Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Fri, 20 May 2022 22:08:52 +0800 Subject: Move almost all functions' parameter db.Engine to context.Context (#19748) * Move almost all functions' parameter db.Engine to context.Context * remove some unnecessary wrap functions --- routers/web/webfinger.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'routers/web/webfinger.go') diff --git a/routers/web/webfinger.go b/routers/web/webfinger.go index 27d0351b81..8402967867 100644 --- a/routers/web/webfinger.go +++ b/routers/web/webfinger.go @@ -59,7 +59,7 @@ func WebfingerQuery(ctx *context.Context) { return } - u, err = user_model.GetUserByNameCtx(ctx, parts[0]) + u, err = user_model.GetUserByName(ctx, parts[0]) case "mailto": u, err = user_model.GetUserByEmailContext(ctx, resource.Opaque) if u != nil && u.KeepEmailPrivate { @@ -79,7 +79,7 @@ func WebfingerQuery(ctx *context.Context) { return } - if !user_model.IsUserVisibleToViewer(u, ctx.Doer) { + if !user_model.IsUserVisibleToViewer(ctx, u, ctx.Doer) { ctx.Error(http.StatusNotFound) return } -- cgit v1.2.3