aboutsummaryrefslogtreecommitdiff
path: root/routes/outbox.go
diff options
context:
space:
mode:
authorFChannel <>2022-05-03 22:42:24 -0700
committerFChannel <>2022-06-19 12:53:29 -0700
commit493fc8e025fd613d9faf0b573d610e4a0e0c0228 (patch)
treefd7f217ca407c1aa8e584db26d0a95944c23b034 /routes/outbox.go
parent328c9150228156c04d1045469c7dbcd7b5f4fedf (diff)
creating boards works
Diffstat (limited to 'routes/outbox.go')
-rw-r--r--routes/outbox.go17
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