diff --git a/packages/backend/src/remote/activitypub/renderer/index.ts b/packages/backend/src/remote/activitypub/renderer/index.ts index 5c6679181..e99bbf2f8 100644 --- a/packages/backend/src/remote/activitypub/renderer/index.ts +++ b/packages/backend/src/remote/activitypub/renderer/index.ts @@ -46,13 +46,8 @@ export const renderActivity = (x: any): IActivity | null => { }, // schema schema: 'http://schema.org/', - PropertyValue: { - '@id': 'schema:PropertyValue', - '@context': { - 'value': 'schema:value', - 'name': 'schema:name', - }, - }, + PropertyValue: 'schema:PropertyValue', + value: 'schema:value', // Misskey misskey: 'https://misskey-hub.net/ns#', '_misskey_quote': { diff --git a/packages/backend/src/remote/activitypub/renderer/person.ts b/packages/backend/src/remote/activitypub/renderer/person.ts index 68f813aa8..dd6562e78 100644 --- a/packages/backend/src/remote/activitypub/renderer/person.ts +++ b/packages/backend/src/remote/activitypub/renderer/person.ts @@ -24,6 +24,7 @@ export async function renderPerson(user: ILocalUser) { const attachment: { type: 'PropertyValue', name: string, + 'schema:name': string, value: string, identifier?: IIdentifier }[] = []; @@ -44,6 +45,15 @@ export async function renderPerson(user: ILocalUser) { attachment.push({ type: 'PropertyValue', name: field.name, + // uses "name" for backward compatibility, but JSON-LD-expanding + // it ends up being the ActivityPub name property, which is not + // correct for this type. which is why we also send the "correct" + // schema.org name property field, which would not be recognized + // by people just processing JSON-LD as JSON as allowed by the spec. + // it would be nicer to do this with JSON-LD context, but this is + // only possible when using JSON-LD 1.1 with nested contexts, but + // activitystreams 2.0 requires the JSON-LD 1.0 expansion algorithm. + 'schema:name': field.name, value, }); }