From fd73fad148a500bd95a575fe6e4b73a25882fb89 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 5 Apr 2018 00:50:57 +0900 Subject: wip --- src/remote/activitypub/act/create.ts | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'src/remote') diff --git a/src/remote/activitypub/act/create.ts b/src/remote/activitypub/act/create.ts index 7ee9f8dfb7..957900900f 100644 --- a/src/remote/activitypub/act/create.ts +++ b/src/remote/activitypub/act/create.ts @@ -63,32 +63,26 @@ export default async (actor, activity): Promise => { throw new Error('invalid note'); } - const mediaIds = []; + const media = []; if ('attachment' in note) { note.attachment.forEach(async media => { const created = await createImage(resolver, media); - mediaIds.push(created._id); + media.push(created); }); } const { window } = new JSDOM(note.content); await createPost(actor, { - channelId: undefined, - index: undefined, createdAt: new Date(note.published), - mediaIds, - replyId: undefined, - repostId: undefined, - poll: undefined, + media, + reply: undefined, + repost: undefined, text: window.document.body.textContent, - textHtml: note.content && createDOMPurify(window).sanitize(note.content), - userId: actor._id, - appId: null, viaMobile: false, geo: undefined, uri: note.id - }, null, null, []); + }); } }; -- cgit v1.2.3-freya