From adced26955e81433bd4009e870a3681368c8d7ba Mon Sep 17 00:00:00 2001 From: Sven Sauleau Date: Mon, 13 Feb 2023 10:03:00 +0000 Subject: [PATCH] Disjoint Link from Object Link was extending Object which was a mistake (as pointed out in https://github.com/cloudflare/wildebeest/issues/35). This change disjoints Link and Object objects, as specified by https://www.w3.org/TR/activitystreams-vocabulary/#dfn-link. --- backend/src/activitypub/objects/link.ts | 5 +++-- backend/src/activitypub/objects/mention.ts | 4 +--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/backend/src/activitypub/objects/link.ts b/backend/src/activitypub/objects/link.ts index 4b828e2..b1f8582 100644 --- a/backend/src/activitypub/objects/link.ts +++ b/backend/src/activitypub/objects/link.ts @@ -1,6 +1,7 @@ -import type { APObject } from 'wildebeest/backend/src/activitypub/objects' +// https://www.w3.org/TR/activitystreams-vocabulary/#dfn-link +export interface Link { + type: string -export interface Link extends APObject { href: URL name: string } diff --git a/backend/src/activitypub/objects/mention.ts b/backend/src/activitypub/objects/mention.ts index 1215cc6..3e24501 100644 --- a/backend/src/activitypub/objects/mention.ts +++ b/backend/src/activitypub/objects/mention.ts @@ -2,14 +2,12 @@ import type { Link } from 'wildebeest/backend/src/activitypub/objects/link' import type { Actor } from 'wildebeest/backend/src/activitypub/actors' import { urlToHandle } from 'wildebeest/backend/src/utils/handle' +// https://www.w3.org/TR/activitystreams-vocabulary/#dfn-mention export interface Mention extends Link {} export function newMention(actor: Actor): Mention { return { type: 'Mention', - id: actor.id, - url: actor.id, - href: actor.id, name: urlToHandle(actor.id), }