Skip to content

Commit

Permalink
Troubleshooting Mastodon Federation
Browse files Browse the repository at this point in the history
grrr...
  • Loading branch information
benpate committed Aug 29, 2024
1 parent bc76eb7 commit eba15c4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions handler/activitypub_stream/outbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func GetOutboxCollection(serverFactory *server.Factory) echo.HandlerFunc {
publishDateString := ctx.QueryParam("publishDate")

if publishDateString == "" {
ctx.Response().Header().Set("Content-Type", "application/activity+json")
// ctx.Response().Header().Set("Content-Type", vocab.ContentTypeActivityPub) <- removing to test compatability issues with Mastodon
result := activitypub.Collection(stream.ActivityPubOutboxURL())
return ctx.JSON(http.StatusOK, result)
}
Expand All @@ -51,7 +51,7 @@ func GetOutboxCollection(serverFactory *server.Factory) echo.HandlerFunc {
}

// Return results as an OrderedCollectionPage
ctx.Response().Header().Set("Content-Type", "application/activity+json")
// ctx.Response().Header().Set("Content-Type", vocab.ContentTypeActivityPub) <- removing to test compatability issues with Mastodon
result := activitypub.CollectionPage(stream.ActivityPubOutboxURL(), pageSize, messages)
return ctx.JSON(http.StatusOK, result)
}
Expand Down
3 changes: 1 addition & 2 deletions handler/activitypub_user/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,11 @@ func RenderProfileJSONLD(context echo.Context, factory *domain.Factory, user *mo
userJSON := user.GetJSONLD()
userJSON[vocab.PropertyPublicKey] = mapof.Any{
vocab.PropertyID: user.ActivityPubPublicKeyURL(),
vocab.PropertyType: vocab.ObjectTypeKey,
vocab.PropertyOwner: user.ActivityPubURL(),
vocab.PropertyPublicKeyPEM: key.PublicPEM,
}

// Return the user's profile in JSON-LD format
context.Response().Header().Set(vocab.ContentType, vocab.ContentTypeActivityPub)
// context.Response().Header().Set(vocab.ContentType, vocab.ContentTypeActivityPub) <- removing to test compatability issues with Mastodon
return context.JSON(http.StatusOK, userJSON)
}
2 changes: 2 additions & 0 deletions model/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ func (user User) GetJSONLD() mapof.Any {
vocab.PropertyFollowing: user.ActivityPubFollowingURL(),
vocab.PropertyFollowers: user.ActivityPubFollowersURL(),
vocab.PropertyLiked: user.ActivityPubLikedURL(),
// TODO: Revisit FEP-c648
// https://codeberg.org/fediverse/fep/src/branch/main/fep/c648/fep-c648.md
// vocab.PropertyBlocked: user.ActivityPubBlockedURL(), // Temporarily removed because of problems with Mastodon parsing JSON-LD. Maybe this is it?
}

Expand Down

0 comments on commit eba15c4

Please sign in to comment.