homepage change: only followed honkers shown, allow silence with -.

This commit is contained in:
Ted Unangst 2019-05-17 17:53:06 -04:00
parent 32782d5356
commit cead81bccb
1 changed files with 7 additions and 2 deletions

View File

@ -594,7 +594,7 @@ func gethonksbyuser(name string) []*Honk {
}
func gethonksforuser(userid int64) []*Honk {
dt := time.Now().UTC().Add(-7 * 24 * time.Hour).Format(dbtimeformat)
rows, err := stmtHonksForUser.Query(userid, dt, userid)
rows, err := stmtHonksForUser.Query(userid, dt, userid, userid)
return getsomehonks(rows, err)
}
func gethonksforme(userid int64) []*Honk {
@ -949,6 +949,11 @@ func showcombos(w http.ResponseWriter, r *http.Request) {
for _, h := range honkers {
combos = append(combos, h.Combos...)
}
for i, c := range combos {
if c == "-" {
combos[i] = ""
}
}
combos = oneofakind(combos)
sort.Strings(combos)
templinfo["Combos"] = combos
@ -1320,7 +1325,7 @@ func prepareStatements(db *sql.DB) {
stmtOneXonk = preparetodie(db, selecthonks+"where honks.userid = ? and xid = ?")
stmtPublicHonks = preparetodie(db, selecthonks+"where honker = '' and dt > ?"+limit)
stmtUserHonks = preparetodie(db, selecthonks+"where honker = '' and username = ? and dt > ?"+limit)
stmtHonksForUser = preparetodie(db, selecthonks+"where honks.userid = ? and dt > ?"+butnotthose+limit)
stmtHonksForUser = preparetodie(db, selecthonks+"where honks.userid = ? and dt > ? and honker in (select xid from honkers where userid = ? and flavor = 'sub' and combos not like '% - %')"+butnotthose+limit)
stmtHonksForMe = preparetodie(db, selecthonks+"where honks.userid = ? and dt > ? and whofore = 1"+butnotthose+limit)
stmtHonksByHonker = preparetodie(db, selecthonks+"join honkers on honkers.xid = honks.honker where honks.userid = ? and honkers.name = ?"+butnotthose+limit)
stmtHonksByCombo = preparetodie(db, selecthonks+"join honkers on honkers.xid = honks.honker where honks.userid = ? and honkers.combos like ?"+butnotthose+limit)