all honk operations on all the pages
Ted Unangst tedu@tedunangst.com
Tue, 23 Apr 2019 16:48:25 -0400
1 files changed,
8 insertions(+),
5 deletions(-)
jump to
M
honk.go
→
honk.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 {