diff options
author | FChannel <=> | 2021-01-25 13:02:40 -0800 |
---|---|---|
committer | FChannel <=> | 2021-01-25 13:02:40 -0800 |
commit | 7823265b9a7bea93befdd9b04c4332be5c5b0404 (patch) | |
tree | b0cd6f742ae8637a8ed9a9323a5b9b6e2f662010 /Database.go | |
parent | 3b923a6f098cacf35f309e44a4c67a6a576fba4e (diff) |
feedback loop fix with getting actor collection
Diffstat (limited to 'Database.go')
-rw-r--r-- | Database.go | 18 |
1 files changed, 2 insertions, 16 deletions
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 } |