From 6503beecc5543e9b5b41890d537eeb228717c00a Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Tue, 3 Apr 2018 12:25:13 +0900 Subject: [PATCH] Explicityly wrap objects with Create activity --- src/processor/http/deliver-post.ts | 8 +++++--- src/remote/activitypub/renderer/create.ts | 4 ++++ 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 src/remote/activitypub/renderer/create.ts diff --git a/src/processor/http/deliver-post.ts b/src/processor/http/deliver-post.ts index 83ac8281f4..1389aede8c 100644 --- a/src/processor/http/deliver-post.ts +++ b/src/processor/http/deliver-post.ts @@ -5,6 +5,7 @@ import Post, { pack } from '../../models/post'; import User, { isLocalUser } from '../../models/user'; import stream, { publishChannelStream } from '../../publishers/stream'; import context from '../../remote/activitypub/renderer/context'; +import renderCreate from '../../remote/activitypub/renderer/create'; import renderNote from '../../remote/activitypub/renderer/note'; import request from '../../remote/request'; @@ -49,9 +50,10 @@ export default ({ data }) => Post.findOne({ _id: data.id }).then(post => { }); } - return renderNote(user, post).then(rendered => { - rendered['@context'] = context; - return request(user, following.follower[0].account.inbox, rendered); + return renderNote(user, post).then(note => { + const create = renderCreate(note); + create['@context'] = context; + return request(user, following.follower[0].account.inbox, create); }); }))) ); diff --git a/src/remote/activitypub/renderer/create.ts b/src/remote/activitypub/renderer/create.ts new file mode 100644 index 0000000000..de411e1951 --- /dev/null +++ b/src/remote/activitypub/renderer/create.ts @@ -0,0 +1,4 @@ +export default object => ({ + type: 'Create', + object +});