all repos — honk @ 461126c939183e2c99baf290c00e6613dc9b0ca7

my fork of honk

unbonking should work now
Ted Unangst tedu@tedunangst.com
Tue, 27 Aug 2019 22:15:53 -0400
commit

461126c939183e2c99baf290c00e6613dc9b0ca7

parent

90903da8e866912e74605556a6d8300afc7fbfa2

4 files changed, 18 insertions(+), 5 deletions(-)

jump to
M activity.goactivity.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.txtdocs/changelog.txt

@@ -2,6 +2,8 @@ changelog

-- next ++ Unbonking. + ++ Hashtags that work? + Dynamic refresh.
M fun.gofun.go

@@ -49,6 +49,8 @@ h.URL = h.XID

if h.What != "bonked" { h.Noise = mentionize(h.Noise) h.Noise = ontologize(h.Noise) + } else { + h.Flags |= flagIsBonked } h.Username, h.Handle = handles(h.Honker) } else {
M honk.gohonk.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 (?, ?, ?, ?, ?, ?)")