From 553dcfbdaf3fecc8dcad7d14c131c156a39fc28c Mon Sep 17 00:00:00 2001 From: Dima Krasner Date: Wed, 18 Oct 2023 09:20:45 +0300 Subject: [PATCH] if parent post is thread head, hide one link to it --- front/view.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/front/view.go b/front/view.go index 669f5a38..91f4ae17 100644 --- a/front/view.go +++ b/front/view.go @@ -188,9 +188,9 @@ func view(w text.Writer, r *request) { w.Link(fmt.Sprintf("/users/view/%x", sha256.Sum256([]byte(note.InReplyTo))), "View parent post") } - if threadHead.Valid && threadHead.String != note.ID && r.User == nil { + if threadHead.Valid && threadHead.String != note.ID && threadHead.String != note.InReplyTo && r.User == nil { w.Link(fmt.Sprintf("/view/%x", sha256.Sum256([]byte(threadHead.String))), "View first post in thread") - } else if threadHead.Valid && threadHead.String != note.ID { + } else if threadHead.Valid && threadHead.String != note.ID && threadHead.String != note.InReplyTo { w.Link(fmt.Sprintf("/users/view/%x", sha256.Sum256([]byte(threadHead.String))), "View first post in thread") }