1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-11-21 08:31:27 -05:00

Use data from actor, improve formatting

This commit is contained in:
erik 2023-11-23 17:04:58 +01:00 committed by Michael Jerger
parent aee2ee2596
commit 34c511ae98

View file

@ -105,11 +105,17 @@ func RepositoryInbox(ctx *context.APIContext) {
log.Info("RepositoryInbox: Actor parsed. %v", actor) log.Info("RepositoryInbox: Actor parsed. %v", actor)
// get_person_by_rest // get_person_by_rest
c := api.NewHTTPClientWithConfig(strfmt.Default, c := api.NewHTTPClientWithConfig(
api.DefaultTransportConfig().WithHost("localhost:3000").WithBasePath("/api/v1/").WithSchemes([]string{"http"})) 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 //c := client.Default
person, err := c.Activitypub.ActivitypubPerson( 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("http client. %v", c)
log.Info("person: %v\n error: ", person, err) log.Info("person: %v\n error: ", person, err)