From 49e944d8d210d949f322c7c27e7ffa76d520101b Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Tue, 17 Sep 2019 10:11:10 -0400 Subject: [PATCH] comment the hot mess, just in case i forget --- web.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/web.go b/web.go index 5788f6e..2571887 100644 --- a/web.go +++ b/web.go @@ -841,12 +841,17 @@ func edithonkpage(w http.ResponseWriter, r *http.Request) { return } + noise := honk.Noise + if honk.Precis != "" { + noise = honk.Precis + "\n\n" + noise + } + honks := []*Honk{honk} reverbolate(u.UserID, honks) templinfo := getInfo(r) templinfo["HonkCSRF"] = login.GetCSRF("honkhonk", r) templinfo["Honks"] = honks - templinfo["Noise"] = honk.Noise + templinfo["Noise"] = noise templinfo["ServerMessage"] = "honk edit" templinfo["UpdateXID"] = honk.XID err := readviews.Execute(w, "honkpage.html", templinfo) @@ -855,6 +860,7 @@ func edithonkpage(w http.ResponseWriter, r *http.Request) { } } +// what a hot mess this function is func submithonk(w http.ResponseWriter, r *http.Request) { rid := r.FormValue("rid") noise := r.FormValue("noise") @@ -1054,9 +1060,7 @@ func submithonk(w http.ResponseWriter, r *http.Request) { if updatexid != "" { updatehonk(honk) - } else { - err := savehonk(honk) if err != nil { log.Printf("uh oh")