From 7823265b9a7bea93befdd9b04c4332be5c5b0404 Mon Sep 17 00:00:00 2001 From: FChannel <=> Date: Mon, 25 Jan 2021 13:02:40 -0800 Subject: feedback loop fix with getting actor collection --- Database.go | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'Database.go') diff --git a/Database.go b/Database.go index 313ffd8..5a11f22 100644 --- a/Database.go +++ b/Database.go @@ -25,8 +25,6 @@ func GetActorFromDB(db *sql.DB, id string) Actor { CheckError(err, "error with actor from db scan ") } - nActor.AtContext.Context = "https://www.w3.org/ns/activitystreams" - return nActor } @@ -47,8 +45,6 @@ func GetActorByNameFromDB(db *sql.DB, name string) Actor { CheckError(err, "error with actor from db scan ") } - nActor.AtContext.Context = "https://www.w3.org/ns/activitystreams" - return nActor } @@ -399,13 +395,6 @@ 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 @@ -486,11 +475,9 @@ func GetObjectRepliesDB(db *sql.DB, parent ObjectBase) (*CollectionBase, int, in nColl.OrderedItems = result - /* - remoteCollection := GetObjectRepliesRemote(db, parent) + + remoteCollection, postc, imgc := GetObjectRepliesCache(db, parent) - var postc int - var imgc int for _, e := range remoteCollection.OrderedItems { nColl.OrderedItems = append(nColl.OrderedItems, e) postc = postc + 1 @@ -498,7 +485,6 @@ func GetObjectRepliesDB(db *sql.DB, parent ObjectBase) (*CollectionBase, int, in imgc = imgc + 1 } } -*/ return &nColl, 0, 0 } -- cgit v1.2.3