diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-04-23 15:27:01 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-04-23 15:27:01 +0900 |
| commit | 02bb99ac029e8fc12aec384717341f603052d7c0 (patch) | |
| tree | 1dcce6bdb5f329f58e8e6772c6717f49d658863b /src/remote/activitypub/kernel | |
| parent | サーバーのバージョンとクライアントのバージョンを分... (diff) | |
| download | sharkey-02bb99ac029e8fc12aec384717341f603052d7c0.tar.gz sharkey-02bb99ac029e8fc12aec384717341f603052d7c0.tar.bz2 sharkey-02bb99ac029e8fc12aec384717341f603052d7c0.zip | |
他のMisskeyインスタンスにリアクション情報を伝えるように
Diffstat (limited to 'src/remote/activitypub/kernel')
| -rw-r--r-- | src/remote/activitypub/kernel/like.ts | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/remote/activitypub/kernel/like.ts b/src/remote/activitypub/kernel/like.ts index fc5d0a2f61..17ec73f12b 100644 --- a/src/remote/activitypub/kernel/like.ts +++ b/src/remote/activitypub/kernel/like.ts @@ -3,6 +3,7 @@ import Note from '../../../models/note'; import { IRemoteUser } from '../../../models/user'; import { ILike } from '../type'; import create from '../../../services/note/reaction/create'; +import { validateReaction } from '../../../models/note-reaction'; export default async (actor: IRemoteUser, activity: ILike) => { const id = typeof activity.object == 'string' ? activity.object : activity.object.id; @@ -17,5 +18,14 @@ export default async (actor: IRemoteUser, activity: ILike) => { throw new Error(); } - await create(actor, note, 'pudding'); + let reaction = 'pudding'; + + // 他のMisskeyインスタンスからのリアクション + if (activity._misskey_reaction) { + if (validateReaction.ok(activity._misskey_reaction)) { + reaction = activity._misskey_reaction; + } + } + + await create(actor, note, reaction); }; |