From 6a0f664b565716ad08301e7699d6c0393dbba977 Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Sun, 22 May 2022 13:02:48 -0700 Subject: following pass through --- routes/util.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'routes/util.go') diff --git a/routes/util.go b/routes/util.go index 94337bc..ed5dfb7 100644 --- a/routes/util.go +++ b/routes/util.go @@ -201,19 +201,19 @@ func ParseOutboxRequest(ctx *fiber.Ctx, actor activitypub.Actor) error { break case "Follow": - var validActor bool - var validLocalActor bool - - validActor = (activity.Object.Actor != "") - validLocalActor = (activity.Actor.Id == actor.Id) + validActor := (activity.Object.Actor != "") + validLocalActor := (activity.Actor.Id == actor.Id) var rActivity activitypub.Activity + if validActor && validLocalActor { rActivity = activity.AcceptFollow() rActivity, err = rActivity.SetActorFollowing() + if err != nil { return util.MakeError(err, "ParseOutboxRequest") } + if err := activity.MakeRequestInbox(); err != nil { return util.MakeError(err, "ParseOutboxRequest") } @@ -221,11 +221,13 @@ func ParseOutboxRequest(ctx *fiber.Ctx, actor activitypub.Actor) error { actor, _ := activitypub.GetActorFromDB(config.Domain) webfinger.FollowingBoards, err = actor.GetFollowing() + if err != nil { return util.MakeError(err, "ParseOutboxRequest") } webfinger.Boards, err = webfinger.GetBoardCollection() + if err != nil { return util.MakeError(err, "ParseOutboxRequest") } -- cgit v1.2.3