aboutsummaryrefslogtreecommitdiff
path: root/outboxGet.go
diff options
context:
space:
mode:
authorFChannel <=>2021-01-28 12:31:44 -0800
committerFChannel <=>2021-01-28 12:31:44 -0800
commitee3c47a5b2251380ded1239b149fd1f6e6514bfb (patch)
tree4464e74060f84e47ef19a8449cdce02f4307ee0f /outboxGet.go
parentfaee9db270a22a42e45210529c7998dcede0087b (diff)
dont write to cache if local actor
Diffstat (limited to 'outboxGet.go')
-rw-r--r--outboxGet.go8
1 files changed, 6 insertions, 2 deletions
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)
}