diff options
| author | mei23 <m@m544.net> | 2018-08-17 06:40:08 +0900 |
|---|---|---|
| committer | mei23 <m@m544.net> | 2018-08-17 06:40:50 +0900 |
| commit | a89c20657262441701bb50cd83d9d317940fc857 (patch) | |
| tree | 721036cca6d09303c1dfea8a07728b7a8043c818 /src/remote/activitypub/renderer | |
| parent | Merge pull request #2272 from mei23/mei-0817-debuglog (diff) | |
| download | misskey-a89c20657262441701bb50cd83d9d317940fc857.tar.gz misskey-a89c20657262441701bb50cd83d9d317940fc857.tar.bz2 misskey-a89c20657262441701bb50cd83d9d317940fc857.zip | |
Fix Announce Activity
Diffstat (limited to 'src/remote/activitypub/renderer')
| -rw-r--r-- | src/remote/activitypub/renderer/announce.ts | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/remote/activitypub/renderer/announce.ts b/src/remote/activitypub/renderer/announce.ts index 7a3f886447..6d5a67b5c3 100644 --- a/src/remote/activitypub/renderer/announce.ts +++ b/src/remote/activitypub/renderer/announce.ts @@ -1,5 +1,15 @@ -export default (id: string, object: any) => ({ - type: 'Announce', - id, - object -}); +import config from '../../../config'; +import { INote } from '../../../models/note'; + +export default (object: any, note: INote) => { + const attributedTo = `${config.url}/users/${note.userId}`; + + return { + id: `${config.url}/notes/${note._id}`, + type: 'Announce', + published: note.createdAt.toISOString(), + to: ['https://www.w3.org/ns/activitystreams#Public'], + cc: [attributedTo, `${attributedTo}/followers`], + object + }; +}; |