From 7d8bea7be87219ba919908e91a71870ce6f1f45f Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Tue, 16 Apr 2019 17:11:04 -0400 Subject: [PATCH] display reply id where present --- fun.go | 3 +++ views/honk.html | 11 ++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/fun.go b/fun.go index cf3b726..f1f2f87 100644 --- a/fun.go +++ b/fun.go @@ -38,6 +38,9 @@ func reverbolate(honks []*Honk) { } else { h.URL = h.XID } + if h.RID != "" && strings.IndexByte(h.RID, '/') == -1 { + h.RID = h.Honker + "/h/" + h.RID + } } else { idx := strings.LastIndexByte(h.Honker, '/') if idx != -1 { diff --git a/views/honk.html b/views/honk.html index ec53dce..30807ee 100644 --- a/views/honk.html +++ b/views/honk.html @@ -1,6 +1,15 @@
{{ with .Honk }} -
avatar

{{ .Username }} {{ .What }} {{ .Date.Format "02 Jan 2006 15:04" }} {{ .URL }}

+
+avatar +

{{ .Username }} {{ .What }} {{ .Date.Format "02 Jan 2006 15:04" }} {{ .URL }} +{{ if .RID }} +
+ +in reply to: {{ .RID }} + +{{ end }} +

{{ .HTML }} {{ range .Donks }}