diff --git a/src/activitypub/mocks.js b/src/activitypub/mocks.js index f9bcad3f2b..f0bca1f134 100644 --- a/src/activitypub/mocks.js +++ b/src/activitypub/mocks.js @@ -282,11 +282,27 @@ Mocks.note = async (post) => { } let attachment = await posts.attachments.get(post.pid) || []; - attachment = attachment.map(({ mediaType, url }) => ({ - type: 'Document', - mediaType, - url, - })); + attachment = attachment.map(({ mediaType, url }) => { + let type; + + switch (true) { + case mediaType.startsWith('image'): { + type = 'Image'; + break; + } + + default: { + type = 'Link'; + break; + } + } + + return { + type, + mediaType, + url, + }; + }); const object = { '@context': 'https://www.w3.org/ns/activitystreams',