1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-11-24 08:57:03 -05:00

Remove redundant ValidateStar and err check, call coorect function

This commit is contained in:
erik 2023-11-24 12:51:36 +01:00 committed by Michael Jerger
parent 43ac3ddca9
commit 6284355e1e

View file

@ -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 {