We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9368cfc commit d09b47dCopy full SHA for d09b47d
routers/user/profile.go
@@ -235,17 +235,7 @@ func Profile(ctx *context.Context) {
235
}
236
237
238
- var showEmail bool
239
-
240
- if len(ctxUser.Email) > 0 && ctx.IsSigned && !ctxUser.KeepEmailPrivate {
241
- showEmail = true
242
- } else if ctx.IsSigned {
243
- // Show email if the authenticated user owns the profile
244
- // being viewed
245
- showEmail = ctxUser.ID == ctx.User.ID
246
- }
247
248
- ctx.Data["ShowUserEmail"] = showEmail
+ ctx.Data["ShowUserEmail"] = len(ctxUser.Email) > 0 && ctx.IsSigned && (!ctxUser.KeepEmailPrivate || ctxUser.ID == ctx.User.ID)
249
250
ctx.HTML(200, tplProfile)
251
0 commit comments