aboutsummaryrefslogtreecommitdiff
path: root/client.go
diff options
context:
space:
mode:
authorFChannel <=>2021-01-23 13:53:25 -0800
committerFChannel <=>2021-01-23 13:53:25 -0800
commit000c206417a91d0f910cba35d16d433a1f038530 (patch)
tree19cf45955dffbb6caaef6ef7a339d671c6aaf596 /client.go
parent2566e314e8351ffbceae9a2688d90a5c811d49e5 (diff)
foundation for cache retrieval
Diffstat (limited to 'client.go')
-rw-r--r--client.go12
1 files changed, 9 insertions, 3 deletions
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
}
}