From 34c511ae98a5702258f77e15ca7a539001d849cd Mon Sep 17 00:00:00 2001 From: erik Date: Thu, 23 Nov 2023 17:04:58 +0100 Subject: [PATCH] Use data from actor, improve formatting --- routers/api/v1/activitypub/repository.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/routers/api/v1/activitypub/repository.go b/routers/api/v1/activitypub/repository.go index 012f5b156f..ad3041f212 100644 --- a/routers/api/v1/activitypub/repository.go +++ b/routers/api/v1/activitypub/repository.go @@ -105,11 +105,17 @@ func RepositoryInbox(ctx *context.APIContext) { log.Info("RepositoryInbox: Actor parsed. %v", actor) // get_person_by_rest - c := api.NewHTTPClientWithConfig(strfmt.Default, - api.DefaultTransportConfig().WithHost("localhost:3000").WithBasePath("/api/v1/").WithSchemes([]string{"http"})) + c := api.NewHTTPClientWithConfig( + strfmt.Default, + api.DefaultTransportConfig(). + WithHost(actor.GetHostAndPort()). + WithBasePath("/api/v1/"). // ToDo: Is there a need to get the base path dynamically? + WithSchemes([]string{"http", "https"})) //c := client.Default + person, err := c.Activitypub.ActivitypubPerson( - apiPerson.NewActivitypubPersonParams().WithUserID(1), nil) + apiPerson.NewActivitypubPersonParams(). + WithUserID(int64(actor.GetUserId())), nil) log.Info("http client. %v", c) log.Info("person: %v\n error: ", person, err)