diff options
author | FChannel <> | 2022-05-03 22:42:24 -0700 |
---|---|---|
committer | FChannel <> | 2022-06-19 12:53:29 -0700 |
commit | 493fc8e025fd613d9faf0b573d610e4a0e0c0228 (patch) | |
tree | fd7f217ca407c1aa8e584db26d0a95944c23b034 /routes/outbox.go | |
parent | 328c9150228156c04d1045469c7dbcd7b5f4fedf (diff) |
creating boards works
Diffstat (limited to 'routes/outbox.go')
-rw-r--r-- | routes/outbox.go | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/routes/outbox.go b/routes/outbox.go index 8049bd5..c7ca7b4 100644 --- a/routes/outbox.go +++ b/routes/outbox.go @@ -12,14 +12,23 @@ import ( ) func Outbox(ctx *fiber.Ctx) error { - // STUB - return ctx.SendString("main outbox") + actor, err := webfinger.GetActorFromPath(ctx.Path(), "/") + if err != nil { + return err + } + + if activitypub.AcceptActivity(ctx.Get("Accept")) { + activitypub.GetActorOutbox(ctx, actor) + return nil + } + + return ParseOutboxRequest(ctx, actor) } func OutboxGet(ctx *fiber.Ctx) error { - actor := webfinger.GetActorByName(ctx.Params("actor")) + actor, _ := activitypub.GetActorByNameFromDB(ctx.Params("actor")) if activitypub.AcceptActivity(ctx.Get("Accept")) { activitypub.GetActorInfo(ctx, actor.Id) @@ -62,7 +71,7 @@ func OutboxGet(ctx *fiber.Ctx) error { data.Board.InReplyTo = "" data.Board.To = actor.Outbox data.Board.Actor = actor - data.Board.ModCred, _ = getPassword(ctx) + data.Board.ModCred, _ = db.GetPassword(ctx) data.Board.Domain = config.Domain data.Board.Restricted = actor.Restricted data.CurrentPage = page |