unbonking should work now
Ted Unangst tedu@tedunangst.com
Tue, 27 Aug 2019 22:15:53 -0400
4 files changed,
18 insertions(+),
5 deletions(-)
M
activity.go
→
activity.go
@@ -234,7 +234,7 @@ _, err := stmtZonkDonks.Exec(xonk.ID)
if err != nil { log.Printf("error eradicating: %s", err) } - _, err = stmtZonkIt.Exec(user.ID, x.XID) + _, err = stmtZonkIt.Exec(xonk.ID) if err != nil { log.Printf("error eradicating: %s", err) }
M
docs/changelog.txt
→
docs/changelog.txt
@@ -2,6 +2,8 @@ changelog
-- next ++ Unbonking. + ++ Hashtags that work? + Dynamic refresh.
M
honk.go
→
honk.go
@@ -850,7 +850,7 @@
func getbonk(userid int64, xid string) *Honk { h := new(Honk) var dt, aud string - row := stmtOneXonk.QueryRow(userid, xid) + row := stmtOneBonk.QueryRow(userid, xid) err := row.Scan(&h.ID, &h.UserID, &h.Username, &h.What, &h.Honker, &h.Oonker, &h.XID, &h.RID, &dt, &h.URL, &aud, &h.Noise, &h.Precis, &h.Convoy, &h.Whofore, &h.Flags) if err != nil {@@ -1083,7 +1083,16 @@
if wherefore == "unbonk" { xonk := getbonk(userinfo.UserID, what) if xonk != nil { - _, err := stmtClearFlags.Exec(flagIsBonked, xonk.ID) + _, err := stmtZonkDonks.Exec(xonk.ID) + if err != nil { + log.Printf("error zonking: %s", err) + } + _, err = stmtZonkIt.Exec(xonk.ID) + if err != nil { + log.Printf("error zonking: %s", err) + } + xonk = getxonk(userinfo.UserID, what) + _, err = stmtClearFlags.Exec(flagIsBonked, xonk.ID) if err != nil { log.Printf("error unbonking: %s", err) }@@ -1100,7 +1109,7 @@ _, err := stmtZonkDonks.Exec(xonk.ID)
if err != nil { log.Printf("error zonking: %s", err) } - _, err = stmtZonkIt.Exec(userinfo.UserID, what) + _, err = stmtZonkIt.Exec(xonk.ID) if err != nil { log.Printf("error zonking: %s", err) }@@ -1799,7 +1808,7 @@ stmtSaveOnts = preparetodie(db, "insert into onts (ontology, honkid) values (?, ?)")
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 (?, ?)") - stmtZonkIt = preparetodie(db, "delete from honks where userid = ? and xid = ?") + stmtZonkIt = preparetodie(db, "delete from honks where honkid = ?") stmtZonkDonks = preparetodie(db, "delete from donks where honkid = ?") stmtFindFile = preparetodie(db, "select fileid from files where url = ? and local = 1") stmtSaveFile = preparetodie(db, "insert into files (xid, name, url, media, local, content) values (?, ?, ?, ?, ?, ?)")