all repos — honk @ 406646bc1eb70967225810a6388d7f8723b7a14e

my fork of honk

all honk operations on all the pages
Ted Unangst tedu@tedunangst.com
Tue, 23 Apr 2019 16:48:25 -0400
commit

406646bc1eb70967225810a6388d7f8723b7a14e

parent

1b5598e4865536f91a2285ed5cbaada3f04d6fc7

1 files changed, 8 insertions(+), 5 deletions(-)

jump to
M honk.gohonk.go

@@ -422,14 +422,14 @@ func viewhonker(w http.ResponseWriter, r *http.Request) {

name := mux.Vars(r)["name"] u := GetUserInfo(r) honks := gethonksbyhonker(u.UserID, name) - honkpage(w, r, nil, nil, honks) + honkpage(w, r, u, nil, honks) } func viewcombo(w http.ResponseWriter, r *http.Request) { name := mux.Vars(r)["name"] u := GetUserInfo(r) honks := gethonksbycombo(u.UserID, name) - honkpage(w, r, nil, nil, honks) + honkpage(w, r, u, nil, honks) } func fingerlicker(w http.ResponseWriter, r *http.Request) {

@@ -502,14 +502,17 @@ w.Header().Set("Content-Type", theonetruename)

WriteJunk(w, j) return } - honkpage(w, r, nil, nil, []*Honk{h}) + u := GetUserInfo(r) + honkpage(w, r, u, nil, []*Honk{h}) } func honkpage(w http.ResponseWriter, r *http.Request, u *UserInfo, user *WhatAbout, honks []*Honk) { reverbolate(honks) templinfo := getInfo(r) - if u != nil && u.Username == user.Name { - templinfo["UserCSRF"] = GetCSRF("saveuser", r) + if u != nil { + if user != nil && u.Username == user.Name { + templinfo["UserCSRF"] = GetCSRF("saveuser", r) + } templinfo["HonkCSRF"] = GetCSRF("honkhonk", r) } if u == nil {