From 67496c12086fa5cf96ac7c94959dc5eb6e92c613 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Tue, 13 Jun 2023 19:26:35 -0400 Subject: [PATCH] another try at flattening logic --- web.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web.go b/web.go index a48095f..a76ebfb 100644 --- a/web.go +++ b/web.go @@ -1023,6 +1023,9 @@ func threadsort(honks []*Honk) []*Honk { kids := make(map[string][]*Honk) for _, h := range honks { honkx[h.XID] = h + if h.RID == "" { + honkx[""] = h + } rid := h.RID kids[rid] = append(kids[rid], h) } @@ -1037,7 +1040,7 @@ func threadsort(honks []*Honk) []*Honk { p.Style += fmt.Sprintf(" level%d", level) } levelup := true - if pp := honkx[p.RID]; pp == nil || p.Honker == pp.Honker { + if pp := honkx[p.RID]; pp != nil && p.Honker == pp.Honker { levelup = false } if levelup {