move final bits of follow into activty

This commit is contained in:
Ted Unangst 2020-09-10 14:46:36 -04:00
parent 1e632a8ddb
commit a7aa60aeca
2 changed files with 5 additions and 8 deletions

View File

@ -1729,11 +1729,7 @@ func unfollowme(user *WhatAbout, who string, name string, j junk.Junk) {
} }
} }
func followyou(user *WhatAbout, target string) { func followyou(user *WhatAbout, honkerid int64) {
}
func refollowyou(user *WhatAbout, honkerid int64) {
var url, owner string var url, owner string
db := opendatabase() db := opendatabase()
row := db.QueryRow("select xid, owner from honkers where honkerid = ? and userid = ? and flavor in ('unsub', 'peep', 'presub', 'sub')", row := db.QueryRow("select xid, owner from honkers where honkerid = ? and userid = ? and flavor in ('unsub', 'peep', 'presub', 'sub')",

7
web.go
View File

@ -1841,7 +1841,7 @@ func submithonker(w http.ResponseWriter, r *http.Request) {
return return
} }
if goodbye == "X" { if goodbye == "X" {
refollowyou(user, honkerid) followyou(user, honkerid)
http.Redirect(w, r, "/honkers", http.StatusSeeOther) http.Redirect(w, r, "/honkers", http.StatusSeeOther)
return return
} }
@ -1902,13 +1902,14 @@ func submithonker(w http.ResponseWriter, r *http.Request) {
return return
} }
_, err = stmtSaveHonker.Exec(u.UserID, name, url, flavor, combos, info.Owner, mj) res, err := stmtSaveHonker.Exec(u.UserID, name, url, flavor, combos, info.Owner, mj)
if err != nil { if err != nil {
log.Print(err) log.Print(err)
return return
} }
honkerid, _ = res.LastInsertId()
if flavor == "presub" { if flavor == "presub" {
go subsub(user, url, info.Owner) followyou(user, honkerid)
} }
http.Redirect(w, r, "/honkers", http.StatusSeeOther) http.Redirect(w, r, "/honkers", http.StatusSeeOther)
} }