From 000c206417a91d0f910cba35d16d433a1f038530 Mon Sep 17 00:00:00 2001 From: FChannel <=> Date: Sat, 23 Jan 2021 13:53:25 -0800 Subject: foundation for cache retrieval --- client.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'client.go') diff --git a/client.go b/client.go index 976eb31..d62c26f 100644 --- a/client.go +++ b/client.go @@ -56,6 +56,7 @@ type AdminPage struct { Followers []string Reported []Report Domain string + IsLocal bool } type Report struct { @@ -396,11 +397,16 @@ func WantToServe(db *sql.DB, actorName string) (Collection, bool) { if boardActor.Id == "" { boardActor = GetActor(e.Id) } - - if boardActor.Id == actorName { + + if boardActor.Name == actorName { serve = true - collection = GetActorCollection(boardActor.Outbox) + if IsActorLocal(db, boardActor.Id) { + collection = GetActorCollectionDB(db, boardActor) + } else { + collection = GetActorCollectionCache(db, boardActor) + } collection.Actor = &boardActor + return collection, serve } } -- cgit v1.2.3