Skip to content

Commit

Permalink
if parent post is thread head, hide one link to it
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkr committed Oct 18, 2023
1 parent 84a388d commit 553dcfb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions front/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down

0 comments on commit 553dcfb

Please sign in to comment.