From afe2c0d1768a932b5904e2ef1b4a2bb72f93f52b Mon Sep 17 00:00:00 2001 From: Umputun Date: Mon, 28 May 2018 19:29:32 -0500 Subject: [PATCH] add tree comments expains the method of filling Info --- app/rest/tree.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/rest/tree.go b/app/rest/tree.go index 0b3aee32..5b76b775 100644 --- a/app/rest/tree.go +++ b/app/rest/tree.go @@ -8,7 +8,7 @@ import ( "github.com/umputun/remark/app/store" ) -// Tree is formatter making tree from list of comments +// Tree is formatter making tree from the list of comments type Tree struct { Nodes []*Node `json:"comments"` Info store.PostInfo `json:"info,omitempty"` @@ -30,6 +30,9 @@ type recurData struct { } // MakeTree gets unsorted list of comments and produces Tree +// It will make store.PostInfo by itself and will mark Info.ReadOnly based on passed readOnlyAge +// Tree maker is local and has no access to the data store. By this reason it has to make Info and won't be able +// to handle store's read-only status. This status should be set by caller. func MakeTree(comments []store.Comment, sortType string, readOnlyAge int) *Tree { if len(comments) == 0 { return &Tree{}