diff options
author | FChannel <> | 2022-05-02 12:44:41 -0700 |
---|---|---|
committer | FChannel <> | 2022-06-19 12:53:29 -0700 |
commit | 1ee6552559141dd5dba91abec7c81d68c56abda0 (patch) | |
tree | 4ac21571a27980e8ebf83a065c270b36cc3ecfd6 /activitypub | |
parent | 733f911fadc872933481bcbe087d519ce00372df (diff) |
removed all unneeded .go files from root directory
Diffstat (limited to 'activitypub')
-rw-r--r-- | activitypub/actor.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/activitypub/actor.go b/activitypub/actor.go index e837df5..3fbcb75 100644 --- a/activitypub/actor.go +++ b/activitypub/actor.go @@ -863,3 +863,33 @@ func WriteActorObjectToCache(obj ObjectBase) (ObjectBase, error) { return obj, nil } + +func GetActorOutbox(ctx *fiber.Ctx, actor Actor) error { + + var collection Collection + + c, err := GetActorObjectCollectionFromDB(actor.Id) + if err != nil { + return err + } + collection.OrderedItems = c.OrderedItems + + collection.AtContext.Context = "https://www.w3.org/ns/activitystreams" + collection.Actor = &actor + + collection.TotalItems, err = GetObjectPostsTotalDB(actor) + if err != nil { + return err + } + + collection.TotalImgs, err = GetObjectImgsTotalDB(actor) + if err != nil { + return err + } + + enc, _ := json.Marshal(collection) + + ctx.Response().Header.Set("Content-Type", config.ActivityStreams) + _, err = ctx.Write(enc) + return err +} |