only delete honks for user that receives deletion

This commit is contained in:
Ted Unangst 2019-04-24 17:34:58 -04:00
parent 9a4e2900ac
commit d728004cad
2 changed files with 2 additions and 2 deletions

View File

@ -247,7 +247,7 @@ func needxonk(user *WhatAbout, x *Honk) bool {
func savexonk(user *WhatAbout, x *Honk) {
if x.What == "eradicate" {
log.Printf("eradicating %s by %s", x.RID, x.Honker)
_, err := stmtDeleteHonk.Exec(x.RID, x.Honker)
_, err := stmtDeleteHonk.Exec(x.RID, x.Honker, user.ID)
if err != nil {
log.Printf("error eradicating: %s", err)
}

View File

@ -1208,7 +1208,7 @@ func prepareStatements(db *sql.DB) {
stmtFileData = preparetodie(db, "select media, content from files where xid = ?")
stmtFindXonk = preparetodie(db, "select honkid from honks where userid = ? and xid = ?")
stmtSaveDonk = preparetodie(db, "insert into donks (honkid, fileid) values (?, ?)")
stmtDeleteHonk = preparetodie(db, "update honks set what = 'zonk' where xid = ? and honker = ?")
stmtDeleteHonk = preparetodie(db, "update honks set what = 'zonk' where xid = ? and honker = ? and userid = ?")
stmtFindFile = preparetodie(db, "select fileid from files where url = ?")
stmtSaveFile = preparetodie(db, "insert into files (xid, name, url, media, content) values (?, ?, ?, ?, ?)")
stmtWhatAbout = preparetodie(db, "select userid, username, displayname, about, pubkey from users where username = ?")