aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFChannel <=>2021-01-24 22:35:03 -0800
committerFChannel <=>2021-01-24 22:35:03 -0800
commitf6ccb7e03ff6aff01acd7f2b40346156e7b8b10b (patch)
treedc164f98deb8ba5e2efebaf8a2bca253b3a3cdaf
parent3d307abbdf1c0ee711c80c753930a88014c8925a (diff)
getting cached replies
-rw-r--r--Database.go7
1 files changed, 7 insertions, 0 deletions
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