From 1ee6552559141dd5dba91abec7c81d68c56abda0 Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Mon, 2 May 2022 12:44:41 -0700 Subject: removed all unneeded .go files from root directory --- activitypub/actor.go | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'activitypub/actor.go') 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 +} -- cgit v1.2.3