From 41b2943dba9993bd4b8c5a6e4546d8e23dce7662 Mon Sep 17 00:00:00 2001 From: Guillermo Serrahima Date: Sat, 21 Mar 2026 02:21:37 +0100 Subject: Changed parents string array to Note array + rendering threads in frontend --- backend/notes/note.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'backend/notes/note.go') diff --git a/backend/notes/note.go b/backend/notes/note.go index 569188c..36b9f2b 100644 --- a/backend/notes/note.go +++ b/backend/notes/note.go @@ -16,7 +16,7 @@ type Note struct { CreatedAt time.Time `json:"createdAt"` ReplyTo *string `json:"replyTo,omitempty"` Facets []Facet `json:"facets,omitempty"` - Parents []string `json:"parents,omitempty"` + Parents []Note `json:"parents,omitempty"` } type Facet struct { @@ -35,15 +35,15 @@ func MissingNote(uri string) *Note { } } -func isChainContained(smallChain, bigChain []string) bool { +func isChainContained(smallChain, bigChain []Note) bool { if len(smallChain) > len(bigChain) { return false } // check if smallChain is a suffix of bigChain offset := len(bigChain) - len(smallChain) - for i, uri := range smallChain { - if bigChain[offset+i] != uri { + for i, note := range smallChain { + if bigChain[offset+i].URI != note.URI { return false } } -- cgit v1.2.3