all repos — honk @ f2f53fc8bd0ce8a3f0324057cc76105a4d479964

my fork of honk

link to get all the honks in a convoy
Ted Unangst tedu@tedunangst.com
Wed, 24 Apr 2019 02:37:36 -0400
commit

f2f53fc8bd0ce8a3f0324057cc76105a4d479964

parent

6e6f8bec8597109a496adb9fcf8ba53c8ebb1e52

2 files changed, 14 insertions(+), 2 deletions(-)

jump to
M honk.gohonk.go

@@ -431,6 +431,12 @@ u := GetUserInfo(r)

honks := gethonksbycombo(u.UserID, name) honkpage(w, r, u, nil, honks) } +func viewconvoy(w http.ResponseWriter, r *http.Request) { + c := r.FormValue("c") + u := GetUserInfo(r) + honks := gethonksbyconvoy(u.UserID, c) + honkpage(w, r, u, nil, honks) +} func fingerlicker(w http.ResponseWriter, r *http.Request) { orig := r.FormValue("resource")

@@ -634,6 +640,10 @@ }

func gethonksbycombo(userid int64, combo string) []*Honk { combo = "% " + combo + " %" rows, err := stmtHonksByCombo.Query(userid, combo) + return getsomehonks(rows, err) +} +func gethonksbyconvoy(userid int64, convoy string) []*Honk { + rows, err := stmtHonksByConvoy.Query(userid, convoy) return getsomehonks(rows, err) }

@@ -1147,6 +1157,7 @@ loggedin.Handle("/saveuser", CSRFWrap("saveuser", http.HandlerFunc(saveuser)))

loggedin.HandleFunc("/honkers", viewhonkers) loggedin.HandleFunc("/h/{name:[[:alnum:]]+}", viewhonker) loggedin.HandleFunc("/c/{name:[[:alnum:]]+}", viewcombo) + loggedin.HandleFunc("/t", viewconvoy) loggedin.Handle("/savehonker", CSRFWrap("savehonker", http.HandlerFunc(savehonker))) err = http.Serve(listener, mux)

@@ -1156,7 +1167,7 @@ }

} var stmtHonkers, stmtDubbers, stmtSaveHonker, stmtUpdateHonker *sql.Stmt -var stmtOneXonk, stmtHonks, stmtUserHonks, stmtHonksByCombo *sql.Stmt +var stmtOneXonk, stmtHonks, stmtUserHonks, stmtHonksByCombo, stmtHonksByConvoy *sql.Stmt var stmtHonksForUser, stmtHonksForMe, stmtDeleteHonk, stmtSaveDub *sql.Stmt var stmtHonksByHonker, stmtSaveHonk, stmtFileData, stmtWhatAbout *sql.Stmt var stmtFindXonk, stmtSaveDonk, stmtFindFile, stmtSaveFile *sql.Stmt

@@ -1184,6 +1195,7 @@ stmtHonksForUser = preparetodie(db, "select honkid, honks.userid, users.username, what, honker, xid, rid, dt, url, audience, noise, convoy from honks join users on honks.userid = users.userid where honks.userid = ? and dt > ? and convoy not in (select name from zonkers where userid = ? and wherefore = 'zonvoy' order by zonkerid desc limit 100) order by honkid desc limit 250")

stmtHonksForMe = preparetodie(db, "select honkid, honks.userid, users.username, what, honker, xid, rid, dt, url, audience, noise, convoy from honks join users on honks.userid = users.userid where honks.userid = ? and dt > ? and whofore = 1 and convoy not in (select name from zonkers where userid = ? and wherefore = 'zonvoy' order by zonkerid desc limit 100) order by honkid desc limit 250") stmtHonksByHonker = preparetodie(db, "select honkid, honks.userid, users.username, what, honker, honks.xid, rid, dt, url, audience, noise, convoy from honks join users on honks.userid = users.userid join honkers on honkers.xid = honks.honker where honks.userid = ? and honkers.name = ? order by honkid desc limit 50") stmtHonksByCombo = preparetodie(db, "select honkid, honks.userid, users.username, what, honker, honks.xid, rid, dt, url, audience, noise, convoy from honks join users on honks.userid = users.userid join honkers on honkers.xid = honks.honker where honks.userid = ? and honkers.combos like ? order by honkid desc limit 50") + stmtHonksByConvoy = preparetodie(db, "select honkid, honks.userid, users.username, what, honker, honks.xid, rid, dt, url, audience, noise, convoy from honks join users on honks.userid = users.userid where honks.userid = ? and convoy = ? order by honkid desc limit 50") stmtSaveHonk = preparetodie(db, "insert into honks (userid, what, honker, xid, rid, dt, url, audience, noise, convoy, whofore) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)") stmtFileData = preparetodie(db, "select media, content from files where xid = ?") stmtFindXonk = preparetodie(db, "select honkid from honks where userid = ? and xid = ?")
M views/honk.htmlviews/honk.html

@@ -11,7 +11,7 @@ </span>

{{ end }} <br> <span style="margin-left: 3em;" class="clip"> -convoy: {{ .Convoy }} +convoy: <a href="/t?c={{ .Convoy }}">{{ .Convoy }}</a> </span> </div> <div class="noise">