all repos — honk @ 5e11ab87350e34a9c177b0d884bdebd8f9f7d9a9

my fork of honk

still allow viewing unpublic honks when logged in
Ted Unangst tedu@tedunangst.com
Thu, 04 Jul 2019 10:52:22 -0400
commit

5e11ab87350e34a9c177b0d884bdebd8f9f7d9a9

parent

162663bf800442ac3bf3946eb3de755f990589ed

1 files changed, 11 insertions(+), 2 deletions(-)

jump to
M honk.gohonk.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") }