From f97692c8758302ab922d04c55d1b54fd4e04f297 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Tue, 29 Oct 2019 16:00:41 -0400 Subject: [PATCH] glow the selected honk if not first --- fun.go | 2 +- web.go | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/fun.go b/fun.go index 830c861..60a7708 100644 --- a/fun.go +++ b/fun.go @@ -55,7 +55,7 @@ func reverbolate(userid int64, honks []*Honk) { h.What += "ed" if h.What == "tonked" { h.What = "honked back" - h.Style = "subtle" + h.Style += " subtle" } if !h.Public { h.Style += " limited" diff --git a/web.go b/web.go index 8be8db8..287ae49 100644 --- a/web.go +++ b/web.go @@ -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"] user, err := butwhatabout(name) if err != nil { @@ -899,7 +899,10 @@ func showhonk(w http.ResponseWriter, r *http.Request) { rawhonks := gethonksbyconvoy(honk.UserID, honk.Convoy, 0) reversehonks(rawhonks) 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()) { honks = append(honks, h) } @@ -1938,7 +1941,7 @@ func serve() { getters.HandleFunc("/robots.txt", nomoroboto) getters.HandleFunc("/rss", showrss) 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) posters.HandleFunc("/"+userSep+"/{name:[[:alnum:]]+}/inbox", inbox) getters.HandleFunc("/"+userSep+"/{name:[[:alnum:]]+}/outbox", outbox)