diff options
author | FChannel <> | 2022-04-24 00:46:49 -0700 |
---|---|---|
committer | FChannel <> | 2022-06-19 12:53:29 -0700 |
commit | 3db517715bef6a53225c5c3c06e8fc5fd0bf71e3 (patch) | |
tree | 9aa7fbcb12f2ec8d0e4e66cd85ace058e38dd32d /routes/outbox.go | |
parent | 9718d34a757b66917747c1c4acfb9b35d154625b (diff) |
basic pass over view posts, post, catalog and manage page connections
Diffstat (limited to 'routes/outbox.go')
-rw-r--r-- | routes/outbox.go | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/routes/outbox.go b/routes/outbox.go index b00f946..1277011 100644 --- a/routes/outbox.go +++ b/routes/outbox.go @@ -16,6 +16,14 @@ func Outbox(ctx *fiber.Ctx) error { } func OutboxGet(ctx *fiber.Ctx) error { + + actor := db.GetActorByName(ctx.Params("actor")) + + if util.AcceptActivity(ctx.Get("Accept")) { + db.GetActorInfo(ctx, actor.Id) + return nil + } + collection, valid, err := wantToServePage(ctx.Params("actor"), 0) if err != nil { return err @@ -24,12 +32,13 @@ func OutboxGet(ctx *fiber.Ctx) error { return ctx.SendString("404") } - actor := collection.Actor - + var page int postNum := ctx.Query("page") - page, err := strconv.Atoi(postNum) - if err != nil { - return err + if postNum != "" { + page, err = strconv.Atoi(postNum) + if err != nil { + return err + } } var returnData PageData @@ -39,7 +48,7 @@ func OutboxGet(ctx *fiber.Ctx) error { returnData.Board.Summary = actor.Summary returnData.Board.InReplyTo = "" returnData.Board.To = actor.Outbox - returnData.Board.Actor = *actor + returnData.Board.Actor = actor returnData.Board.ModCred, _ = getPassword(ctx) returnData.Board.Domain = config.Domain returnData.Board.Restricted = actor.Restricted |