From 6284355e1e0f226b478773aa572907ae49ca579d Mon Sep 17 00:00:00 2001 From: erik Date: Fri, 24 Nov 2023 12:51:36 +0100 Subject: [PATCH] Remove redundant ValidateStar and err check, call coorect function --- routers/api/v1/activitypub/repository.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/routers/api/v1/activitypub/repository.go b/routers/api/v1/activitypub/repository.go index 1cfe2830c9..5f9e1c07c7 100644 --- a/routers/api/v1/activitypub/repository.go +++ b/routers/api/v1/activitypub/repository.go @@ -76,18 +76,12 @@ func RepositoryInbox(ctx *context.APIContext) { log.Info("RepositoryInbox: repo %v, %v", ctx.Repo.Repository.OwnerName, ctx.Repo.Repository.Name) opt := web.GetForm(ctx).(*forgefed.Star) - err := opt.ValidateStar() - - if err != nil { - panic(err) - } - log.Info("RepositoryInbox: Activity.Source %v", opt.Source) log.Info("RepositoryInbox: Activity.Actor %v", opt.Actor) // assume actor is: "actor": "https://codeberg.org/api/v1/activitypub/user-id/12345" - NB: This might be actually the ID? Maybe check vocabulary. // parse actor - actor, err := activitypub.ParseActorID(opt.Actor.GetID().String()) // ToDo: somehow extract source from star activity + actor, err := activitypub.ParseActorFromStarActivity(opt) // ToDo: somehow extract source from star activity // Is the actor IRI well formed? if err != nil {