From 20b67a803070b0f6d92fd7253342ec87b387d936 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Fri, 26 Apr 2019 16:27:29 -0400 Subject: [PATCH] make sure to update the right honker --- honk.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/honk.go b/honk.go index 5e56db9..24ef297 100644 --- a/honk.go +++ b/honk.go @@ -348,7 +348,7 @@ func inbox(w http.ResponseWriter, r *http.Request) { case "Accept": db := opendatabase() log.Printf("updating honker accept: %s", who) - db.Exec("update honkers set flavor = 'sub' where xid = ? and flavor = 'presub'", who) + db.Exec("update honkers set flavor = 'sub' where userid = ? and xid = ? and flavor = 'presub'", user.ID, who) case "Undo": obj, ok := jsongetmap(j, "object") if !ok { @@ -359,7 +359,7 @@ func inbox(w http.ResponseWriter, r *http.Request) { case "Follow": log.Printf("updating honker undo: %s", who) db := opendatabase() - db.Exec("update honkers set flavor = 'undub' where xid = ? and flavor = 'dub'", who) + db.Exec("update honkers set flavor = 'undub' where userid = ? and xid = ? and flavor = 'dub'", user.ID, who) case "Like": default: log.Printf("unknown undo: %s", what)