From 0731de07faceb7ffdf1768d8f1d3d9185a719a88 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Tue, 29 Oct 2019 14:18:01 -0400 Subject: [PATCH] fix another botched honker update stmt --- web.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/web.go b/web.go index f6a7d35..8be8db8 100644 --- a/web.go +++ b/web.go @@ -366,7 +366,16 @@ func inbox(w http.ResponseWriter, r *http.Request) { go rubadubdub(user, j) case "Accept": log.Printf("updating honker accept: %s", who) - _, err = stmtUpdateFlavor.Exec("sub", user.ID, who, "presub") + db := opendatabase() + row := db.QueryRow("select name from honkers where userid = ? and xid = ? and flavor in ('presub')", + user.ID, who) + var name string + err := row.Scan(&name) + if err != nil { + log.Printf("can't get honker name: %s", err) + return + } + _, err = stmtUpdateFlavor.Exec("sub", user.ID, who, name, "presub") if err != nil { log.Printf("error updating honker: %s", err) return