glow the selected honk if not first

This commit is contained in:
Ted Unangst 2019-10-29 16:00:41 -04:00
parent 4f386cf558
commit f97692c875
2 changed files with 7 additions and 4 deletions

2
fun.go
View File

@ -55,7 +55,7 @@ func reverbolate(userid int64, honks []*Honk) {
h.What += "ed" h.What += "ed"
if h.What == "tonked" { if h.What == "tonked" {
h.What = "honked back" h.What = "honked back"
h.Style = "subtle" h.Style += " subtle"
} }
if !h.Public { if !h.Public {
h.Style += " limited" h.Style += " limited"

9
web.go
View File

@ -852,7 +852,7 @@ func thelistingoftheontologies(w http.ResponseWriter, r *http.Request) {
} }
} }
func showhonk(w http.ResponseWriter, r *http.Request) { func showonehonk(w http.ResponseWriter, r *http.Request) {
name := mux.Vars(r)["name"] name := mux.Vars(r)["name"]
user, err := butwhatabout(name) user, err := butwhatabout(name)
if err != nil { if err != nil {
@ -899,7 +899,10 @@ func showhonk(w http.ResponseWriter, r *http.Request) {
rawhonks := gethonksbyconvoy(honk.UserID, honk.Convoy, 0) rawhonks := gethonksbyconvoy(honk.UserID, honk.Convoy, 0)
reversehonks(rawhonks) reversehonks(rawhonks)
var honks []*Honk var honks []*Honk
for _, h := range rawhonks { for i, h := range rawhonks {
if i > 0 && h.XID == xid {
h.Style += " glow"
}
if h.Public && (h.Whofore == 2 || h.IsAcked()) { if h.Public && (h.Whofore == 2 || h.IsAcked()) {
honks = append(honks, h) honks = append(honks, h)
} }
@ -1938,7 +1941,7 @@ func serve() {
getters.HandleFunc("/robots.txt", nomoroboto) getters.HandleFunc("/robots.txt", nomoroboto)
getters.HandleFunc("/rss", showrss) getters.HandleFunc("/rss", showrss)
getters.HandleFunc("/"+userSep+"/{name:[[:alnum:]]+}", showuser) getters.HandleFunc("/"+userSep+"/{name:[[:alnum:]]+}", showuser)
getters.HandleFunc("/"+userSep+"/{name:[[:alnum:]]+}/"+honkSep+"/{xid:[[:alnum:]]+}", showhonk) getters.HandleFunc("/"+userSep+"/{name:[[:alnum:]]+}/"+honkSep+"/{xid:[[:alnum:]]+}", showonehonk)
getters.HandleFunc("/"+userSep+"/{name:[[:alnum:]]+}/rss", showrss) getters.HandleFunc("/"+userSep+"/{name:[[:alnum:]]+}/rss", showrss)
posters.HandleFunc("/"+userSep+"/{name:[[:alnum:]]+}/inbox", inbox) posters.HandleFunc("/"+userSep+"/{name:[[:alnum:]]+}/inbox", inbox)
getters.HandleFunc("/"+userSep+"/{name:[[:alnum:]]+}/outbox", outbox) getters.HandleFunc("/"+userSep+"/{name:[[:alnum:]]+}/outbox", outbox)