still allow viewing unpublic honks when logged in
Ted Unangst tedu@tedunangst.com
Thu, 04 Jul 2019 10:52:22 -0400
1 files changed,
11 insertions(+),
2 deletions(-)
jump to
M
honk.go
→
honk.go
@@ -586,10 +586,20 @@ }
xid := fmt.Sprintf("https://%s%s", serverName, r.URL.Path) h := getxonk(user.ID, xid) - if h == nil || !h.Public { + if h == nil { http.NotFound(w, r) return } + u := login.GetUserInfo(r) + if !h.Public { + if u == nil || u.UserID != h.UserID { + http.NotFound(w, r) + return + + } + honkpage(w, r, u, nil, []*Honk{h}, "one honk maybe more") + return + } if friendorfoe(r.Header.Get("Accept")) { donksforhonks([]*Honk{h}) _, j := jonkjonk(user, h)@@ -599,7 +609,6 @@ j.Write(w)
return } honks := gethonksbyconvoy(-1, h.Convoy) - u := login.GetUserInfo(r) honkpage(w, r, u, nil, honks, "one honk maybe more") }