summaryrefslogtreecommitdiff
path: root/src/remote/activitypub
diff options
context:
space:
mode:
authormei23 <m@m544.net>2018-08-25 14:12:44 +0900
committermei23 <m@m544.net>2018-08-25 14:12:44 +0900
commitffcb2f755c2d20e62272212905c7d2ca795e4c3d (patch)
treebf3b6be95cd80849309939c909338d7d673ee3c1 /src/remote/activitypub
parentHTTP Signature検証対象ヘッダにDateが含まれてなくても許容... (diff)
downloadsharkey-ffcb2f755c2d20e62272212905c7d2ca795e4c3d.tar.gz
sharkey-ffcb2f755c2d20e62272212905c7d2ca795e4c3d.tar.bz2
sharkey-ffcb2f755c2d20e62272212905c7d2ca795e4c3d.zip
Send actor in CreateNote, Announce
Diffstat (limited to 'src/remote/activitypub')
-rw-r--r--src/remote/activitypub/renderer/announce.ts1
-rw-r--r--src/remote/activitypub/renderer/create.ts16
2 files changed, 13 insertions, 4 deletions
diff --git a/src/remote/activitypub/renderer/announce.ts b/src/remote/activitypub/renderer/announce.ts
index 6d5a67b5c3..f6276ade04 100644
--- a/src/remote/activitypub/renderer/announce.ts
+++ b/src/remote/activitypub/renderer/announce.ts
@@ -6,6 +6,7 @@ export default (object: any, note: INote) => {
return {
id: `${config.url}/notes/${note._id}`,
+ actor: `${config.url}/users/${note.userId}`,
type: 'Announce',
published: note.createdAt.toISOString(),
to: ['https://www.w3.org/ns/activitystreams#Public'],
diff --git a/src/remote/activitypub/renderer/create.ts b/src/remote/activitypub/renderer/create.ts
index b8bf98a655..42b36195ff 100644
--- a/src/remote/activitypub/renderer/create.ts
+++ b/src/remote/activitypub/renderer/create.ts
@@ -1,4 +1,12 @@
-export default (object: any) => ({
- type: 'Create',
- object
-});
+import config from '../../../config';
+import { INote } from '../../../models/note';
+
+export default (object: any, note: INote) => {
+ return {
+ id: `${config.url}/notes/${note._id}/activity`,
+ actor: `${config.url}/users/${note.userId}`,
+ type: 'Create',
+ published: note.createdAt.toISOString(),
+ object
+ };
+};