From 41e9a10763ecddbe62e79d7384621a42c69201da Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Sat, 26 Nov 2022 18:30:01 +0000 Subject: [PATCH] make fmt --- FEDERATION.md | 4 ++-- routers/api/v1/activitypub/ticket.go | 2 +- routers/web/authorize_interaction.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/FEDERATION.md b/FEDERATION.md index 6aa2cbfb1..86e74892a 100644 --- a/FEDERATION.md +++ b/FEDERATION.md @@ -2,9 +2,9 @@ *This describes Gitea's future federation capabilities, not what it can do currently.* -Gitea is federated using [ActivityPub](https://www.w3.org/TR/activitypub/) and the [ForgeFed extension](https://forgefed.org/) so you can interact with users and repositories from other instances as if they were on your own instance. By using the standardized ActivityPub protocol, users on any fediverse software such as [Mastodon](https://joinmastodon.org/) can follow Gitea users, star repos, receive activity updates, and comment on issues. +Gitea is federated using [ActivityPub](https://www.w3.org/TR/activitypub/) and the [ForgeFed extension](https://forgefed.org/) so you can interact with users and repositories from other instances as if they were on your own instance. By using the standardized ActivityPub protocol, users on any fediverse software such as [Mastodon](https://joinmastodon.org/) can follow Gitea users, star repositories, receive activity updates, and comment on issues. -Currently, C2S ActivityPub is not supported. +C2S ActivityPub is not supported because Gitea already has an existing API. ## Following diff --git a/routers/api/v1/activitypub/ticket.go b/routers/api/v1/activitypub/ticket.go index 9a064673d..09da07e2e 100644 --- a/routers/api/v1/activitypub/ticket.go +++ b/routers/api/v1/activitypub/ticket.go @@ -68,7 +68,7 @@ func Ticket(ctx *context.APIContext) { ticket.Name = ap.NaturalLanguageValuesNew() // Setting a NaturalLanguageValue to a number causes go-ap's JSON parsing to do weird things // Workaround: set it to #1 instead of 1 - err = ticket.Name.Set("en", ap.Content("#" + ctx.Params("id"))) + err = ticket.Name.Set("en", ap.Content("#"+ctx.Params("id"))) if err != nil { ctx.ServerError("Set Name", err) return diff --git a/routers/web/authorize_interaction.go b/routers/web/authorize_interaction.go index 471d4bf37..45c257e62 100644 --- a/routers/web/authorize_interaction.go +++ b/routers/web/authorize_interaction.go @@ -28,7 +28,7 @@ func AuthorizeInteraction(ctx *context.Context) { ctx.ServerError("Fetch", err) return } - + ap.ItemTyperFunc = forgefed.GetItemByType ap.JSONItemUnmarshal = forgefed.JSONUnmarshalerFn ap.NotEmptyChecker = forgefed.NotEmpty @@ -37,7 +37,7 @@ func AuthorizeInteraction(ctx *context.Context) { ctx.ServerError("UnmarshalJSON", err) return } - + switch object.GetType() { case ap.PersonType: // Federated user