From ee3c47a5b2251380ded1239b149fd1f6e6514bfb Mon Sep 17 00:00:00 2001 From: FChannel <=> Date: Thu, 28 Jan 2021 12:31:44 -0800 Subject: dont write to cache if local actor --- outboxGet.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'outboxGet.go') diff --git a/outboxGet.go b/outboxGet.go index 42fafd0..073a4bb 100644 --- a/outboxGet.go +++ b/outboxGet.go @@ -9,7 +9,7 @@ func GetActorOutbox(w http.ResponseWriter, r *http.Request, db *sql.DB) { actor := GetActorFromPath(db, r.URL.Path, "/") var collection Collection - collection.OrderedItems = GetObjectFromDB(db, actor).OrderedItems + collection.OrderedItems = GetObjectFromDB(db, actor.Id).OrderedItems collection.AtContext.Context = "https://www.w3.org/ns/activitystreams" collection.Actor = &actor @@ -28,7 +28,11 @@ func GetObjectsFromFollow(db *sql.DB, actor Actor) []ObjectBase { followingCol = GetActorCollection(actor.Following) for _, e := range followingCol.Items { var followOutbox Collection - followOutbox = GetObjectFromCache(db, e.Id) + if !IsActorLocal(db, e.Id) { + followOutbox = GetObjectFromCache(db, e.Id) + } else { + followOutbox = GetObjectFromDB(db, e.Id) + } for _, e := range followOutbox.OrderedItems { followObj = append(followObj, e) } -- cgit v1.2.3