Remove redundant ValidateStar and err check, call coorect function
This commit is contained in:
parent
43ac3ddca9
commit
6284355e1e
1 changed files with 1 additions and 7 deletions
|
@ -76,18 +76,12 @@ func RepositoryInbox(ctx *context.APIContext) {
|
||||||
log.Info("RepositoryInbox: repo %v, %v", ctx.Repo.Repository.OwnerName, ctx.Repo.Repository.Name)
|
log.Info("RepositoryInbox: repo %v, %v", ctx.Repo.Repository.OwnerName, ctx.Repo.Repository.Name)
|
||||||
opt := web.GetForm(ctx).(*forgefed.Star)
|
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.Source %v", opt.Source)
|
||||||
log.Info("RepositoryInbox: Activity.Actor %v", opt.Actor)
|
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.
|
// 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
|
// 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?
|
// Is the actor IRI well formed?
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue