From 5cb76e8bf5b9c07d6c7980a403dc4faeea37c3b7 Mon Sep 17 00:00:00 2001 From: FChannel <=> Date: Thu, 18 Feb 2021 01:17:28 -0800 Subject: changes to catalog db queries --- client.go | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) (limited to 'client.go') diff --git a/client.go b/client.go index 6625888..11a187f 100644 --- a/client.go +++ b/client.go @@ -150,28 +150,6 @@ func CatalogGet(w http.ResponseWriter, r *http.Request, db *sql.DB, collection C actor := collection.Actor - var mergeCollection Collection - - - - mergeCollection.OrderedItems = collection.OrderedItems - - domainURL := GetDomainURL(*actor) - - if domainURL == Domain { - followCol := GetObjectsFromFollow(db, *actor) - for _, e := range followCol { - if e.Type != "Tombstone" { - mergeCollection.OrderedItems = append(mergeCollection.OrderedItems, e) - } - } - } - - DeleteRemovedPosts(db, &mergeCollection) - DeleteTombstonePosts(&mergeCollection) - - sort.Sort(ObjectBaseSortDesc(mergeCollection.OrderedItems)) - var returnData PageData returnData.Board.Name = actor.Name returnData.Board.PrefName = actor.PreferredUsername @@ -193,7 +171,10 @@ func CatalogGet(w http.ResponseWriter, r *http.Request, db *sql.DB, collection C returnData.Boards = Boards - returnData.Posts = mergeCollection.OrderedItems + DeleteRemovedPosts(db, &collection) + DeleteTombstonePosts(&collection) + + returnData.Posts = collection.OrderedItems t.ExecuteTemplate(w, "layout", returnData) } -- cgit v1.2.3