From f6ccb7e03ff6aff01acd7f2b40346156e7b8b10b Mon Sep 17 00:00:00 2001 From: FChannel <=> Date: Sun, 24 Jan 2021 22:35:03 -0800 Subject: getting cached replies --- Database.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Database.go b/Database.go index 9ebf000..cdf23e7 100644 --- a/Database.go +++ b/Database.go @@ -390,6 +390,13 @@ func GetObjectFromDB(db *sql.DB, actor Actor) Collection { post.Replies.TotalItems, post.Replies.TotalImgs = GetObjectRepliesDBCount(db, post) + var localPost ObjectBase + localPost.Replies, postCnt, imgCnt = GetObjectRepliesCache(db, post) + + for _, e := range localPost.Replies.OrderedItems { + post.Replies.OrderedItems = append(post.Replies.OrderedItems, e) + } + post.Replies.TotalItems = post.Replies.TotalItems + postCnt post.Replies.TotalImgs = post.Replies.TotalImgs + imgCnt -- cgit v1.2.3