all repos — honk @ e99b374a86aaf5a9edada9813d19220a12dc5737

my fork of honk

when looking at another user on the same server, don't display controls.
you can't interact with other users via their pages because technically
it's like they are on a different server.
Ted Unangst tedu@tedunangst.com
Sat, 15 Jul 2023 18:19:12 -0400
commit

e99b374a86aaf5a9edada9813d19220a12dc5737

parent

4e66b441b5be8130fc97d44abe10fd2f8d94e8d5

1 files changed, 10 insertions(+), 3 deletions(-)

jump to
M web.goweb.go

@@ -723,14 +723,19 @@ }

return } u := login.GetUserInfo(r) - honks := gethonksbyuser(name, u != nil && u.Username == name, 0) + if u != nil && u.Username != name { + u = nil + } + honks := gethonksbyuser(name, u != nil, 0) templinfo := getInfo(r) templinfo["PageName"] = "user" templinfo["PageArg"] = name templinfo["Name"] = user.Name templinfo["WhatAbout"] = user.HTAbout templinfo["ServerMessage"] = "" - templinfo["HonkCSRF"] = login.GetCSRF("honkhonk", r) + if u != nil { + templinfo["HonkCSRF"] = login.GetCSRF("honkhonk", r) + } honkpage(w, u, honks, templinfo) }

@@ -1184,7 +1189,9 @@ }

} templinfo["ServerMessage"] = "one honk maybe more" - templinfo["HonkCSRF"] = login.GetCSRF("honkhonk", r) + if u != nil { + templinfo["HonkCSRF"] = login.GetCSRF("honkhonk", r) + } templinfo["APAltLink"] = templates.Sprintf("<link href='%s' rel='alternate' type='application/activity+json'>", xid) honkpage(w, u, honks, templinfo) }