diff options
author | FChannel <> | 2022-05-06 22:45:27 -0700 |
---|---|---|
committer | FChannel <> | 2022-06-19 12:53:29 -0700 |
commit | 39012c6b17073f6933a5ead8beed64df555f7348 (patch) | |
tree | 7784d092fe196a9051c81cf6833997607ad2d268 /routes/actor.go | |
parent | af542e339e5a611d2a1b5876450bee841b577640 (diff) |
converting functions to activitypub object functions
Diffstat (limited to 'routes/actor.go')
-rw-r--r-- | routes/actor.go | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/routes/actor.go b/routes/actor.go index 5cd0fa9..ea8656f 100644 --- a/routes/actor.go +++ b/routes/actor.go @@ -95,7 +95,7 @@ func ActorInbox(ctx *fiber.Ctx) error { if err := activitypub.TombstoneObject(activity.Object.Id); err != nil { return err } - if err := db.UnArchiveLast(actor.Id); err != nil { + if err := actor.UnArchiveLast(); err != nil { return err } break @@ -118,12 +118,12 @@ func ActorInbox(ctx *fiber.Ctx) error { alreadyFollow := false alreadyFollowing := false - autoSub, err := activitypub.GetActorAutoSubscribeDB(response.Actor.Id) + autoSub, err := response.Actor.GetAutoSubscribe() if err != nil { return err } - following, err := activitypub.GetActorFollowingDB(response.Actor.Id) + following, err := response.Actor.GetFollowing() if err != nil { return err } @@ -195,7 +195,7 @@ func ActorOutbox(ctx *fiber.Ctx) error { } if activitypub.AcceptActivity(ctx.Get("Accept")) { - activitypub.GetActorOutbox(ctx, actor) + actor.GetOutbox(ctx) return nil } @@ -203,11 +203,13 @@ func ActorOutbox(ctx *fiber.Ctx) error { } func ActorFollowing(ctx *fiber.Ctx) error { - return activitypub.GetActorFollowing(ctx, config.Domain+"/"+ctx.Params("actor")) + actor, _ := activitypub.GetActorFromDB(config.Domain + "/" + ctx.Params("actor")) + return actor.GetFollowingResp(ctx) } func ActorFollowers(ctx *fiber.Ctx) error { - return activitypub.GetActorFollowers(ctx, config.Domain+"/"+ctx.Params("actor")) + actor, _ := activitypub.GetActorFromDB(config.Domain + "/" + ctx.Params("actor")) + return actor.GetFollowersResp(ctx) } func ActorReported(c *fiber.Ctx) error { |