From 74f5fb1e96e4c18d87ffe6838f4ab448c184ccff Mon Sep 17 00:00:00 2001 From: FChannel <=> Date: Thu, 28 Jan 2021 21:03:46 -0800 Subject: quote bug fix --- CacheDatabase.go | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'CacheDatabase.go') diff --git a/CacheDatabase.go b/CacheDatabase.go index d5f9c97..84a18d0 100644 --- a/CacheDatabase.go +++ b/CacheDatabase.go @@ -404,7 +404,7 @@ func GetObjectRepliesCache(db *sql.DB, parent ObjectBase) (*CollectionBase, int, var postCnt int var imgCnt int - post.Replies, postCnt, imgCnt = GetObjectRepliesRepliesDB(db, post) + post.Replies, postCnt, imgCnt = GetObjectRepliesRepliesCache(db, post) post.Replies.TotalItems, post.Replies.TotalImgs = GetObjectRepliesCacheCount(db, post) @@ -445,18 +445,30 @@ func GetObjectRepliesRepliesCache(db *sql.DB, parent ObjectBase) (*CollectionBas err = rows.Scan(&post.Id, &post.Name, &post.Content, &post.Type, &post.Published, &post.AttributedTo, &attachID, &previewID, &actor.Id) - CheckError(err, "error with replies replies cache scan") post.Actor = &actor post.Attachment = GetObjectAttachmentCache(db, attachID) - post.Preview = GetObjectPreviewCache(db, previewID) + post.Preview = GetObjectPreviewCache(db, previewID) result = append(result, post) } + nColl.OrderedItems = result + + remoteCollection, postc, imgc := GetObjectRepliesReplies(db, parent) + + for _, e := range remoteCollection.OrderedItems { + + nColl.OrderedItems = append(nColl.OrderedItems, e) + postc = postc + 1 + if len(e.Attachment) > 0 { + imgc = imgc + 1 + } + } + return &nColl, 0, 0 } -- cgit v1.2.3