This commit is contained in:
Ted Unangst 2023-03-25 15:10:30 -04:00
commit fc567f7f69
5 changed files with 17 additions and 10 deletions

View File

@ -36,3 +36,5 @@ dac64bc6a93cedeb6ae618cba8f8647af96d2ece v0.9.3
6a522536238fe25b6d048543f52ed406ccf720b2 v0.9.6
bc1bcfb9c0cc86b3c63325b07e13a36b9d4500f0 v0.9.7
916cefdc24363b6e7e193dbde82632c17f58adfd v0.9.8
4b8cf31560b7d1e1696af109b158766c4ce823ab v0.9.9
d7c3a01e7aaef67c40920bbc4e8507350fc33e31 v0.9.91

View File

@ -1932,14 +1932,17 @@ func followyou(user *WhatAbout, honkerid int64, sync bool) {
}
func unfollowyou(user *WhatAbout, honkerid int64, sync bool) {
db := opendatabase()
row := db.QueryRow("select xid, owner, folxid from honkers where honkerid = ? and userid = ? and flavor in ('sub')",
row := db.QueryRow("select xid, owner, folxid, flavor from honkers where honkerid = ? and userid = ? and flavor in ('unsub', 'peep', 'presub', 'sub')",
honkerid, user.ID)
var url, owner, folxid string
err := row.Scan(&url, &owner, &folxid)
var url, owner, folxid, flavor string
err := row.Scan(&url, &owner, &folxid, &flavor)
if err != nil {
elog.Printf("can't get honker xid: %s", err)
return
}
if flavor == "peep" {
return
}
ilog.Printf("unsubscribing from %s", url)
_, err = db.Exec("update honkers set flavor = ? where honkerid = ?", "unsub", honkerid)
if err != nil {

View File

@ -1,6 +1,10 @@
changelog
=== next
=== 0.9.91 One More Time
+ Swallow a follow bug.
=== 0.9.9 Eat the Bugs
+ Some fixes for image descriptions.

View File

@ -1,5 +1,5 @@
PROGS=autobonker gettoken saytheday sprayandpray wonkawonk youvegothonks
PROGS=autobonker gettoken saytheday sprayandpray youvegothonks
all: $(PROGS)
@ -18,8 +18,5 @@ saytheday: saytheday.go
sprayandpray: sprayandpray.go
go build sprayandpray.go
wonkawonk: wonkawonk.go fetch.go
go build wonkawonk.go fetch.go
youvegothonks: youvegothonks.go
go build youvegothonks.go

5
web.go
View File

@ -1964,7 +1964,8 @@ func submithonker(w http.ResponseWriter, r *http.Request) *Honker {
flavor = "peep"
}
id, err := savehonker(user, url, name, flavor, combos, mj)
var err error
honkerid, err = savehonker(user, url, name, flavor, combos, mj)
if err != nil {
http.Error(w, "had some trouble with that: "+err.Error(), http.StatusInternalServerError)
return nil
@ -1972,7 +1973,7 @@ func submithonker(w http.ResponseWriter, r *http.Request) *Honker {
if flavor == "presub" {
followyou(user, honkerid, false)
}
h.ID = id
h.ID = honkerid
return h
}