all repos — honk @ 6ee14862c0c3842dc1bf86505b6f5b7804d9bf84

my fork of honk

fix another botched honker update stmt
Ted Unangst tedu@tedunangst.com
Tue, 29 Oct 2019 14:18:01 -0400
commit

6ee14862c0c3842dc1bf86505b6f5b7804d9bf84

parent

45968526cda8d13cb2a87990d6b57efa64fa55cf

1 files changed, 10 insertions(+), 1 deletions(-)

jump to
M web.goweb.go

@@ -366,7 +366,16 @@ }

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