diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-04-07 17:05:14 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-04-07 17:05:14 +0900 |
| commit | c5f23bce7864bc1cffb82b54f62e019c4c04137d (patch) | |
| tree | 8ec7313f4ec333bcb4ca3e19a5106c602740870c /src/remote/activitypub/renderer | |
| parent | Refactor (diff) | |
| download | misskey-c5f23bce7864bc1cffb82b54f62e019c4c04137d.tar.gz misskey-c5f23bce7864bc1cffb82b54f62e019c4c04137d.tar.bz2 misskey-c5f23bce7864bc1cffb82b54f62e019c4c04137d.zip | |
Implement like
Diffstat (limited to 'src/remote/activitypub/renderer')
| -rw-r--r-- | src/remote/activitypub/renderer/like.ts | 9 | ||||
| -rw-r--r-- | src/remote/activitypub/renderer/note.ts | 4 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/remote/activitypub/renderer/like.ts b/src/remote/activitypub/renderer/like.ts new file mode 100644 index 0000000000..903b10789e --- /dev/null +++ b/src/remote/activitypub/renderer/like.ts @@ -0,0 +1,9 @@ +import config from '../../../config'; + +export default (user, post) => { + return { + type: 'Like', + actor: `${config.url}/@${user.username}`, + object: post.uri ? post.uri : `${config.url}/posts/${post._id}` + }; +}; diff --git a/src/remote/activitypub/renderer/note.ts b/src/remote/activitypub/renderer/note.ts index b971a53951..bbab63db36 100644 --- a/src/remote/activitypub/renderer/note.ts +++ b/src/remote/activitypub/renderer/note.ts @@ -23,7 +23,7 @@ export default async (user: IUser, post: IPost) => { }); if (inReplyToUser !== null) { - inReplyTo = inReplyToPost.uri || `${config.url}/@${inReplyToUser.username}/${inReplyToPost._id}`; + inReplyTo = inReplyToPost.uri || `${config.url}/posts/${inReplyToPost._id}`; } } } else { @@ -33,7 +33,7 @@ export default async (user: IUser, post: IPost) => { const attributedTo = `${config.url}/@${user.username}`; return { - id: `${attributedTo}/${post._id}`, + id: `${config.url}/posts/${post._id}`, type: 'Note', attributedTo, content: post.textHtml, |